Anchorage API reference
    Preparing search index...

    Type Alias GuardedAgentConfig<TAgentId, TTools, TRequestContext>

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

            | "inputProcessors"
            | "outputProcessors"
            | "errorProcessors"
            | "errorProcessorDefaults"
            | "maxProcessorRetries"
            | "defaultGenerateOptionsLegacy"
            | "defaultStreamOptionsLegacy"
            | "defaultOptions"
            | "defaultNetworkOptions"
            | "backgroundTasks"
            | "channels"
            | "durable"
            | "goal"
            | "signals"
            | "editor"
            | "rawConfig",
    > & {
        allowedInputAssetOrigins?: readonly string[];
        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

    • OptionalallowedInputAssetOrigins?: readonly string[]

      Origins user file and image parts may name as network URLs, regardless of who fetches them. Absent or empty refuses all network URLs; data: URLs are inline data. Network URLs in the client tool outputs the call supplies are checked too. The check runs again before each model step. On the durable loop, signals drained before the first model step are not checked. This is independent of connector egress allowlists.

    • 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.