Anchorage API reference
    Preparing search index...

    Narrow in-process API for a guarded agent.

    This handle prevents accidental access to raw Mastra execution methods. It is not a sandbox against hostile code running in the same JavaScript process.

    interface GuardedAgentHandle {
        allowedPrincipalKinds: readonly PrincipalKind[];
        allowedRoles: readonly Role[];
        id: string;
        maxSteps: number;
        generate(
            messages: MessageListInput,
            options: GuardedAgentCallOptions,
        ): Promise<FullOutput<undefined>>;
        stream(
            messages: MessageListInput,
            options: GuardedAgentCallOptions,
        ): Promise<MastraModelOutput<undefined>>;
    }
    Index

    Properties

    allowedPrincipalKinds: readonly PrincipalKind[]

    Exact principal-kind allowlist enforced at every guarded entry.

    allowedRoles: readonly Role[]

    Exact role allowlist enforced at every guarded entry.

    id: string

    Agent identifier used by catalogs and audit resources.

    maxSteps: number

    Fixed maximum execution steps.

    Methods