Patterns
Reference Architecture
Guardrails ACS / Reference Architecture

Reference Architecture at a Glance

Sequence Diagram

sequenceDiagram participant U as User participant A as Observed Agent participant G as Guardian Agent participant T as Tool / MCP Server participant O as OTel/OCSF Sink U->>A: message (hook: User Message) A->>G: evaluate(context) G-->>A: verdict: allow / deny / modify A->>T: toolCallRequest (hook) A->>G: evaluate(tool, params) G-->>A: verdict T-->>A: toolCallResult (hook) A->>G: evaluate(result) G-->>A: verdict A->>O: trace event (every hook) A->>U: agent response (hook: Agent Response) A->>G: evaluate(response) G-->>A: verdict

Every hook in this sequence is a place where the Guardian Agent can intervene β€” and every hook also emits a trace event, so the sequence above is simultaneously your control-flow diagram and your audit-trail diagram.


Architecture Components

1. Observed Agent (Tier 1)

The agent framework or platform that:

  • Exposes standardized hooks at decision points
  • Fires hook events with required context
  • Handles verdicts from the Guardian Agent
  • Emits trace events to observability backend

2. Guardian Agent (Tier 2)

The policy enforcement engine that:

  • Receives hook events from Observed Agents
  • Evaluates events against declarative policy
  • Returns verdicts (allow/deny/modify) with reasoning
  • Integrates enterprise classifiers from Tier 3

3. Enterprise Classifiers (Tier 3)

Organization-specific detection logic that:

  • Provides custom classification for policies
  • Implements industry-specific rules
  • Integrates existing security tooling
  • Maintains organizational compliance requirements

4. Observability Backend

The tracing and monitoring infrastructure that:

  • Receives OpenTelemetry spans from agents
  • Maps security events to OCSF format
  • Forwards events to SIEM systems
  • Supports incident response and compliance audits

5. AgBOM System

The dynamic inventory management that:

  • Tracks all agent components (tools, models, knowledge sources)
  • Updates automatically on capability discovery
  • Maintains approved component lists
  • Supports supply chain security monitoring

Data Flow

Request Flow

  1. User initiates interaction β†’ User Message hook fires
  2. Agent evaluates context β†’ Guardian Agent checks policy
  3. Verdict returned β†’ Agent proceeds, modifies, or blocks
  4. Tool call requested β†’ Tool Call Request hook fires
  5. Guardian Agent evaluates β†’ Tool authorization check
  6. Tool executes β†’ Returns result to agent
  7. Tool result processed β†’ Tool Call Result hook fires
  8. Guardian Agent evaluates β†’ Result filtering/redaction
  9. Agent generates response β†’ Agent Response hook fires
  10. Final policy check β†’ Guardian Agent evaluates outbound content

Trace Flow

Every hook simultaneously emits a trace event:

  1. Hook fires β†’ OpenTelemetry span created
  2. Context captured β†’ Session ID, agent name, reasoning
  3. Span emitted β†’ Sent to observability backend
  4. Security events mapped β†’ Converted to OCSF format
  5. Forwarded to SIEM β†’ Integrated with security monitoring

Inventory Flow

Component discovery triggers AgBOM updates:

  1. New component discovered β†’ Capability discovery event
  2. AgBOM updated β†’ New component added to inventory
  3. Policy check β†’ Component evaluated against approval list
  4. Alert if needed β†’ Security team notified of unapproved component

Deployment Patterns

Centralized Guardian Agent

Multiple Observed Agents β†’ Single Guardian Agent Service

Advantages:

  • Centralized policy management
  • Consistent enforcement across agents
  • Easier monitoring and maintenance

Considerations:

  • Single point of failure (need HA)
  • Network latency for hook evaluation
  • Scalability for high-volume agent fleets

Distributed Guardian Agent

Each Observed Agent β†’ Embedded Guardian Agent SDK

Advantages:

  • Lower latency (local evaluation)
  • No single point of failure
  • Better performance for high-volume agents

Considerations:

  • Policy synchronization complexity
  • More difficult to monitor and maintain
  • Potential for policy drift across agents

Hybrid Approach

Critical Agents β†’ Dedicated Guardian Agent
Standard Agents β†’ Shared Guardian Agent Service

Advantages:

  • Optimizes performance where needed
  • Centralized management for standard cases
  • Flexibility for different agent profiles

Considerations:

  • More complex deployment
  • Need clear criteria for agent classification
  • Multiple deployment patterns to maintain

Integration Points

Framework Integration

Agent frameworks need to implement AOS hooks:

  • LangChain β€” callback-based hook integration
  • CrewAI β€” middleware-based hook system
  • Custom frameworks β€” direct hook implementation
  • Model providers β€” native hook support in platforms

Policy Management

Policies need to be:

  • Declarative β€” defined in policy language, not code
  • Versioned β€” track changes over time
  • Testable β€” validate policies before deployment
  • Deployable β€” automated policy rollout

Observability Integration

Trace data needs to flow to:

  • OpenTelemetry collector β€” span aggregation and processing
  • OCSF mapper β€” security event conversion
  • SIEM systems β€” existing security monitoring infrastructure
  • ** dashboards** β€” real-time monitoring and alerting

Security Tooling Integration

Enterprise classifiers integrate with:

  • DLP systems β€” data loss prevention
  • IAM systems β€” identity and access management
  • Threat intelligence β€” security threat feeds
  • Compliance tools β€” regulatory monitoring and reporting

Security Considerations

Guardian Agent Security

The Guardian Agent itself is a security-critical component:

  • Secure communication β€” encrypted channels between agents and Guardian Agent
  • Authentication β€” verify agent identities before processing hooks
  • Authorization β€” ensure agents can only access appropriate policies
  • Tamper resistance β€” protect Guardian Agent from compromise

Policy Security

Policies are security-sensitive configurations:

  • Access control β€” restrict who can modify policies
  • Version control β€” track all policy changes
  • Approval workflows β€” require review for policy changes
  • Backup and recovery β€” protect against accidental or malicious policy deletion

Trace Data Security

Trace data contains sensitive information:

  • Data minimization β€” only collect necessary trace data
  • Encryption β€” protect trace data in transit and at rest
  • Retention policies β€” define appropriate data retention periods
  • Access controls β€” restrict who can access trace data

AgBOM Security

Component inventories are supply chain critical:

  • Immutable records β€” prevent tampering with historical AgBOM data
  • Cryptographic verification β€” verify component integrity
  • Approval workflows β€” formal process for component approval
  • Continuous monitoring β€” detect unauthorized component changes

Scalability Considerations

Performance Requirements

Guardian Agent evaluation must be fast:

  • Latency budget β€” typically < 100ms for hook evaluation
  • Throughput β€” handle peak agent interaction volumes
  • Resource utilization β€” efficient CPU and memory usage
  • Caching β€” cache policy evaluations where appropriate

High Availability

Guardian Agent is a control plane component:

  • Redundancy β€” deploy multiple instances for failover
  • Load balancing β€” distribute load across instances
  • Health checks β€” monitor Guardian Agent availability
  • Graceful degradation β€” fail-safe behavior if Guardian Agent unavailable

Elastic Scaling

Agent fleets may have variable load:

  • Auto-scaling β€” scale Guardian Agent capacity with demand
  • Resource limits β€” prevent resource exhaustion
  • Priority queuing β€” prioritize critical agent interactions
  • Backpressure handling β€” manage overload situations gracefully

Monitoring and Alerting

Key Metrics

Monitor Guardian Agent health and performance:

  • Hook evaluation latency β€” time to process hook events
  • Policy evaluation rates β€” hooks processed per second
  • Verdict distribution β€” allow/deny/modify ratios
  • Error rates β€” failed evaluations or system errors

Security Alerts

Alert on potential security issues:

  • Unusual deny patterns β€” spikes in denied actions
  • Policy violations β€” repeated attempts to bypass controls
  • Component changes β€” unauthorized AgBOM modifications
  • Authentication failures β€” failed agent authentication attempts

Compliance Monitoring

Track compliance-relevant events:

  • Human oversight events β€” interventions requiring human review
  • Regulatory triggers β€” events mapped to compliance requirements
  • Audit trail completeness β€” verify trace data integrity
  • Policy coverage β€” ensure all required controls are active

Key Takeaways

  1. Every hook is a control point β€” Guardian Agent can intervene at any decision point
  2. Every hook emits a trace β€” complete audit trail for compliance and incident response
  3. Three-tier architecture β€” clear separation between platform, enforcement, and enterprise
  4. Multiple deployment patterns β€” choose centralized, distributed, or hybrid based on needs
  5. Security is critical β€” Guardian Agent itself must be protected and secured
  6. Scalability matters β€” Guardian Agent must handle peak loads with low latency
  7. Monitoring is essential β€” track performance, security, and compliance metrics

Next Steps

  • Governance Checklist β€” assess your implementation maturity
  • Ecosystem & Roadmap β€” understand current ACS status and future plans