Anchorage API reference
    Preparing search index...

    Type Alias GuardedAgentConfig<TAgentId, TTools, TRequestContext>

    GuardedAgentConfig: Omit<
        AgentConfig<TAgentId, TTools, undefined, TRequestContext, false>,

            | "inputProcessors"
            | "outputProcessors"
            | "errorProcessors"
            | "maxProcessorRetries"
            | "defaultGenerateOptionsLegacy"
            | "defaultStreamOptionsLegacy"
            | "defaultOptions"
            | "defaultNetworkOptions"
            | "backgroundTasks"
            | "durable"
            | "goal"
            | "signals"
            | "editor"
            | "rawConfig",
    > & {
        allowedPrincipalKinds?: readonly PrincipalKind[];
        allowedRoles: readonly Role[];
        applicationInputProcessors?: readonly GuardedInputProcessor[];
        applicationOutputProcessors?: readonly GuardedOutputProcessor[];
        audit: AuditLogger;
        maxSteps: number;
        policies: readonly PolicyEvaluator[];
        toolChoice: GuardedToolChoice;
    }

    Construction-time configuration for a guarded Mastra agent.

    Processor and execution defaults are replaced by dedicated validated fields. The factory never accepts an existing raw Agent.

    Type Parameters

    • TAgentId extends string = string
    • TTools extends ToolsInput = ToolsInput
    • TRequestContext extends Record<string, unknown> | unknown = unknown

    Type Declaration

    • OptionalallowedPrincipalKinds?: readonly PrincipalKind[]

      Exact principal kinds authorized for direct and durable execution. Defaults to ['human']: an agent that does not name its automation denies every scheduled, signal, service, and agent-delegated entry.

    • allowedRoles: readonly Role[]

      Exact actor roles authorized for direct and durable execution.

    • OptionalapplicationInputProcessors?: readonly GuardedInputProcessor[]

      Initial-input-only application processors.

    • OptionalapplicationOutputProcessors?: readonly GuardedOutputProcessor[]

      Stream-and-result application output processors.

    • audit: AuditLogger

      Required failure-isolated audit logger for every mandatory gate.

    • maxSteps: number

      Fixed positive step budget for every execution.

    • policies: readonly PolicyEvaluator[]

      Mandatory input and output policies, evaluated in array order.

    • toolChoice: GuardedToolChoice

      Fixed tool-selection behavior for every execution.