Patterns
Three-Tier Architecture
Guardrails ACS / Three-Tier Architecture

The Three-Tier Control Architecture

ACS deliberately splits responsibility so that no single layer has to solve the whole problem.

flowchart TB subgraph T1["Tier 1 β€” Platform layer (one-time)"] A[Agent framework exposes
standardized hooks] end subgraph T2["Tier 2 β€” Open-source enforcement layer"] B[Framework-agnostic SDK
reads declarative policy
and enforces via hooks] end subgraph T3["Enterprise customization layer"] C[Custom classifiers:
PII/PHI detectors, cost control,
industry-specific rules] end A -->|hook events| B C -->|plugs into| B B -->|verdict: allow / deny / modify| A

Tier 1 β€” Platform Layer

One-Time Integration

The agent framework or platform does the integration once: expose the hooks.

Platform Responsibilities

  • Hook exposure β€” implement AOS hook methods at decision points
  • Event emission β€” fire hook events with required context
  • Verdict handling β€” implement allow/deny/modify logic
  • Trace emission β€” emit OpenTelemetry spans for each hook

What the Platform Doesn’t Need

  • Policy understanding β€” the platform doesn’t need to understand policy
  • Security logic β€” enforcement logic lives in Tier 2
  • Enterprise specifics β€” organizational rules live in Tier 3

Platform Examples

  • LangChain β€” agent framework with AOS hook integration
  • CrewAI β€” multi-agent framework with hook support
  • Internal runtimes β€” custom agent platforms implementing AOS hooks
  • Model providers β€” LLM platforms with built-in hook support

Why This Separation Matters

  • Framework portability β€” switch frameworks without rewriting security logic
  • Vendor neutrality β€” use any agent platform with the same enforcement layer
  • Reduced integration burden β€” one-time integration rather than per-policy

Tier 2 β€” Enforcement Layer

Framework-Agnostic SDK

An open-source, framework-agnostic SDK reads declarative policy and enforces it through hooks.

Enforcement Layer Responsibilities

  • Policy evaluation β€” read and interpret declarative policy
  • Hook processing β€” receive and evaluate hook events
  • Verdict generation β€” return allow/deny/modify with reasoning
  • Policy management β€” policy versioning, testing, deployment

Built-in Policy Categories

The enforcement layer includes common policy categories:

  • Input validation β€” reject injection patterns, out-of-scope topics
  • Tool-call authorization β€” evaluate tool requests against policy
  • Output filtering β€” redact sensitive information, block unsafe responses
  • Adversarial-input detection β€” identify and block jailbreak attempts
  • Cost control β€” enforce rate limits, resource quotas
  • Destructive-action review β€” require approval for high-impact actions

Policy Language

The enforcement layer uses a declarative policy language:

hook: message (role=user)
policy: reject-known-injection-patterns, reject-out-of-scope-topics
verdict-on-match: deny
verdict-on-clean: allow

Why This Separation Matters

  • Standardization β€” same policy language across frameworks
  • Portability β€” switch agent platforms without rewriting policies
  • Collaboration β€” security teams can review and approve policies
  • Testing β€” policies can be tested independently of agent implementation

Tier 3 β€” Enterprise Customization Layer

Organization-Specific Classifiers

Your organization’s own detectors plug into Tier 2 without touching the platform.

Enterprise Layer Responsibilities

  • Custom classifiers β€” organization-specific detection logic
  • Industry rules β€” sector-specific regulations and requirements
  • Data sensitivity models β€” organizational data classification
  • Compliance mappings β€” regulatory requirement to control mapping

Enterprise Classifier Examples

Different industries bring different classifiers:

IndustryExample Classifiers
Financial ServicesData sensitivity models, transaction monitoring, fraud detection
HealthcarePHI detection, HIPAA compliance, patient data privacy
GovernmentClassification handling, access control, audit requirements
TechnologyIP protection, code security, API abuse prevention

Integration Pattern

Enterprise classifiers plug into the enforcement layer:

  • As policy extensions β€” additional rules evaluated by Tier 2
  • As external services β€” classification APIs called during evaluation
  • As custom modules β€” pluggable components loaded by the enforcement SDK

Why This Separation Matters

  • Flexibility β€” organizations can encode specific requirements
  • Privacy β€” sensitive rules don’t need to be shared with platform vendors
  • Regulatory compliance β€” industry-specific requirements can be implemented
  • Investment protection β€” existing security tooling can be integrated

How the Tiers Work Together

Event Flow

  1. Tier 1 β€” Agent framework fires a hook event
  2. Tier 2 β€” Enforcement SDK receives the event, evaluates policy
  3. Tier 3 β€” Enterprise classifiers provide additional context
  4. Tier 2 β€” Enforcement SDK generates verdict (allow/deny/modify)
  5. Tier 1 β€” Agent framework handles the verdict

Policy Flow

  1. Tier 3 β€” Enterprise defines custom classifiers and rules
  2. Tier 2 β€” Enforcement SDK loads and integrates enterprise policies
  3. Tier 2 β€” Policy evaluation combines built-in and enterprise rules
  4. Tier 1 β€” Agent framework is unaware of policy specifics

Benefits of This Architecture

BenefitDescription
PortabilitySwitch agent frameworks without rewriting security logic
StandardizationCommon policy language across platforms
CollaborationSecurity teams can review policies without understanding frameworks
ExtensibilityOrganizations can add custom rules without touching platforms
TestingEach layer can be tested independently
MaintenanceClear ownership boundaries reduce coordination overhead

Implementation Considerations

Tier 1 Implementation

  • One-time cost β€” implement hooks once per framework
  • Standard interface β€” use AOS hook specifications
  • Minimal policy logic β€” focus on event emission and verdict handling
  • Framework support β€” check if your framework already has AOS integration

Tier 2 Implementation

  • Choose an SDK β€” select or build an enforcement SDK
  • Policy development β€” develop declarative policies for your use cases
  • Testing β€” test policies in isolation before deployment
  • Monitoring β€” track policy evaluation metrics and false positives/negatives

Tier 3 Implementation

  • Identify requirements β€” map organizational and regulatory requirements
  • Develop classifiers β€” build or integrate detection logic
  • Test integration β€” verify classifiers work with enforcement SDK
  • Maintain updates β€” keep classifiers current with changing requirements

Key Takeaways

  1. Tier 1 (Platform) β€” one-time hook integration, no policy logic required
  2. Tier 2 (Enforcement) β€” framework-agnostic SDK with declarative policy language
  3. Tier 3 (Enterprise) β€” custom classifiers for organizational requirements
  4. Clear separation β€” each layer has distinct responsibilities and boundaries
  5. Portability β€” switch frameworks without rewriting security logic

Next Steps

  • OWASP Risk Mapping β€” see how the three-tier architecture addresses specific risks
  • Implementation Guide β€” follow the step-by-step process to implement each tier