Skip to content

Implementation patterns (reference flows)

Basic tool access flow

sequenceDiagram
    participant Agent
    participant SAG as Secure Agent Gateway
    participant PDP as Policy Decision Point
    participant Tool
    participant Human as Human Approver
    participant Audit as Audit Engine

    Agent->>SAG: Tool request + credentials
    SAG->>SAG: Authenticate agent
    SAG->>PDP: Evaluate access policy
    PDP-->>SAG: Allow/Deny/Escalate decision

    alt Policy allows
        SAG->>Tool: Execute tool operation
        Tool-->>SAG: Tool response
        SAG->>Audit: Log lineage metadata
        SAG-->>Agent: Success response
    else Policy requires human approval
        SAG->>Human: Request approval with context
        Human-->>SAG: Approve/Deny decision
        alt Human approves
            SAG->>Tool: Execute tool operation
            Tool-->>SAG: Tool response
            SAG-->>Agent: Success response
        else Human denies
            SAG-->>Agent: Human denied + reason
        end
    else Policy denies
        SAG-->>Agent: Access denied + reason
    end

    SAG->>Audit: Log access attempt + decision + lineage

Token mediation flow

sequenceDiagram
    participant Agent
    participant SAG as Secure Agent Gateway
    participant TokenSvc as Token Service
    participant ExternalMCP as External MCP Server

    Agent->>SAG: Request with OAuth token
    SAG->>TokenSvc: Exchange token with resource indicator
    TokenSvc-->>SAG: Scoped token for target resource
    SAG->>ExternalMCP: Forward request with scoped token
    ExternalMCP-->>SAG: Tool response
    SAG-->>Agent: Response

13a. SAG Implementation Pattern

Coming soon.

13b. Policy Development Pattern

Coming soon.

13c. A2A Communication Pattern

Coming soon.

13d. Anti‑patterns (what not to do)

Coming soon.