Zero Trust Application Architecture AGENTS.md Template
AGENTS.md Template for zero trust application architecture that codifies the roles, handoffs, and governance needed for AI coding agents to operate with strong security and policy enforcement.
Target User
Developers, security engineers, platform teams, engineering leaders
Use Cases
- Policy automation for zero trust access
- Identity and device posture evaluation
- Service-to-service authorization
- Audit and compliance reporting
Markdown Template
Zero Trust Application Architecture AGENTS.md Template
# AGENTS.md
Project Role
- Objective: enable a zero trust architecture across the application stack through policy automation, posture checks, and continuous verification.
Agent roster and responsibilities
- PolicyDesignerAgent: writes policy rules for identity, device posture, and network segmentation
- IdentityVerifierAgent: validates user identity, device posture, and context against identity providers
- AccessEnforcementAgent: enforces decisions at gateways, API gateways, and service meshes
- SecretsManagerAgent: handles ephemeral credentials and secrets rotation
- TelemetryAgent: collects security telemetry and distributes to SIEM and audit systems
- AuditorAgent: ensures policy conformance and generates audit artifacts
- OrchestratorAgent: coordinates tasks, context, timing, and handoffs
- DomainSpecialistAgent: applies domain-specific checks for your tech stack
Supervisor or orchestrator behavior
- OrchestratorAgent maintains a centralized policy store and a memory cache of active judgments
- It triggers agent tasks, tracks progress, times out stalled work, and escalates when risk exceeds thresholds
- All outputs are written to a source of truth and are versioned for reproducibility
Handoff rules between agents
- On completion, an agent passes a minimal viable context: policyId, requestId, actor, target, timestamp, and memory references
- The receiving agent must validate context against the policy store and source of truth before action
- Any rework due to failure or mismatch restarts from the orchestrator with updated context
Context, memory, and source-of-truth rules
- Use a single policy store as the definitive truth
- Memory is accessible to all agents and has a TTL of 60 minutes
- Do not preserve raw secrets in memory; fetch ephemeral credentials on demand
Tool access and permission rules
- Agents can call only allowed endpoints via orchestrated adapters
- Secrets fetched through the SecretsManager with ephemeral tokens
- Production changes require approval gates and audit logs
Architecture rules
- Zero trust implies continuous verification at every boundary
- Use a service mesh with strict mTLS and fine-grained access policies
- Policy evaluation is stateless; state is persisted only in the policy store
File structure rules
- Root AGENTS.md at repo root
- policies/ contains policy files in YAML or JSON
- agents/ contains agent implementations and adapters
- src/ runtime code
- tests/ for unit and integration tests
Data, API, or integration rules
- All data in transit must be encrypted
- API calls include a verifiable assertion token
- Avoid logging sensitive data; redact PII
Validation rules
- Verify policy decisions against test vectors
- Validate that handoffs preserve necessary context
- Ensure outputs are deterministic for identical inputs
Security rules
- Secrets encryption at rest and in transit
- Ephemeral credentials with short lifetimes
- Access controls based on least privilege
- Monitor for anomalous policy evaluation patterns
Testing rules
- Unit tests for each agent
- Integration tests for end-to-end policy evaluation flows
- End-to-end tests simulate breach scenarios and recovery
Deployment rules
- CI/CD to staging with canary deployment
- Rollback plan to last good policy state
- Immutable policy artifacts published to policy store
Human review and escalation rules
- High risk or ambiguous decisions require human review
- Escalation paths documented in runbooks
Failure handling and rollback rules
- Idempotent actions and deterministic side effects
- If a step fails, rollback to the last known-good policy and notify the orchestrator
- All failures must be recorded in audit logs
Things Agents must not do
- Do not bypass policy checks
- Do not store raw secrets in memory
- Do not modify production state without approval
- Do not perform actions without explicit escalation when requiredOverview
Direct answer: This AGENTS.md Template codifies a zero trust application architecture workflow for AI coding agents using a multi-agent orchestration pattern. It defines roles, memory, and governance to enable safe, policy-driven automation across apps and services, including handoffs and human review where required. It is suitable for both single agent and multi agent orchestration scenarios.
The template provides a precise operating manual that teams can paste into an AGENTS.md file to establish project level operating context for policy evaluation, enforcement, and audit in zero trust environments.
When to Use This AGENTS.md Template
- When building or operating a zero trust architecture for cloud or on-prem apps
- When multiple agents must coordinate policy decisions across gateways, service mesh, and API layers
- When you need formal handoffs and escalation paths for policy decisions
- When audits and compliance reporting are required as part of release cycles
Copyable AGENTS.md Template
# AGENTS.md
Project Role
- Objective: enable a zero trust architecture across the application stack through policy automation, posture checks, and continuous verification.
Agent roster and responsibilities
- PolicyDesignerAgent: writes policy rules for identity, device posture, and network segmentation
- IdentityVerifierAgent: validates user identity, device posture, and context against identity providers
- AccessEnforcementAgent: enforces decisions at gateways, API gateways, and service meshes
- SecretsManagerAgent: handles ephemeral credentials and secrets rotation
- TelemetryAgent: collects security telemetry and distributes to SIEM and audit systems
- AuditorAgent: ensures policy conformance and generates audit artifacts
- OrchestratorAgent: coordinates tasks, context, timing, and handoffs
- DomainSpecialistAgent: applies domain-specific checks for your tech stack
Supervisor or orchestrator behavior
- OrchestratorAgent maintains a centralized policy store and a memory cache of active judgments
- It triggers agent tasks, tracks progress, times out stalled work, and escalates when risk exceeds thresholds
- All outputs are written to a source of truth and are versioned for reproducibility
Handoff rules between agents
- On completion, an agent passes a minimal viable context: policyId, requestId, actor, target, timestamp, and memory references
- The receiving agent must validate context against the policy store and source of truth before action
- Any rework due to failure or mismatch restarts from the orchestrator with updated context
Context, memory, and source-of-truth rules
- Use a single policy store as the definitive truth
- Memory is accessible to all agents and has a TTL of 60 minutes
- Do not preserve raw secrets in memory; fetch ephemeral credentials on demand
Tool access and permission rules
- Agents can call only allowed endpoints via orchestrated adapters
- Secrets fetched through the SecretsManager with ephemeral tokens
- Production changes require approval gates and audit logs
Architecture rules
- Zero trust implies continuous verification at every boundary
- Use a service mesh with strict mTLS and fine-grained access policies
- Policy evaluation is stateless; state is persisted only in the policy store
File structure rules
- Root AGENTS.md at repo root
- policies/ contains policy files in YAML or JSON
- agents/ contains agent implementations and adapters
- src/ runtime code
- tests/ for unit and integration tests
Data, API, or integration rules
- All data in transit must be encrypted
- API calls include a verifiable assertion token
- Avoid logging sensitive data; redact PII
Validation rules
- Verify policy decisions against test vectors
- Validate that handoffs preserve necessary context
- Ensure outputs are deterministic for identical inputs
Security rules
- Secrets encryption at rest and in transit
- Ephemeral credentials with short lifetimes
- Access controls based on least privilege
- Monitor for anomalous policy evaluation patterns
Testing rules
- Unit tests for each agent
- Integration tests for end-to-end policy evaluation flows
- End-to-end tests simulate breach scenarios and recovery
Deployment rules
- CI/CD to staging with canary deployment
- Rollback plan to last good policy state
- Immutable policy artifacts published to policy store
Human review and escalation rules
- High risk or ambiguous decisions require human review
- Escalation paths documented in runbooks
Failure handling and rollback rules
- Idempotent actions and deterministic side effects
- If a step fails, rollback to the last known-good policy and notify the orchestrator
- All failures must be recorded in audit logs
Things Agents must not do
- Do not bypass policy checks
- Do not store raw secrets in memory
- Do not modify production state without approval
- Do not perform actions without explicit escalation when required
Recommended Agent Operating Model
The agent operating model defines clear roles, decision boundaries, and escalation paths. In zero trust, autonomy is bounded by policy and trust sources. The orchestrator coordinates between policy designers, identity verifiers, and enforcement agents, while the auditor and domain specialist provide governance and domain alignment. Escalations route to security leads when risk thresholds are crossed.
Recommended Project Structure
root
policies/
zero_trust_policies.yaml
agents/
policy_designer/
identity_verifier/
access_enforcement/
secrets_manager/
telemetry/
auditor/
orchestrator/
domain_specialist/
src/
tests/
Core Operating Principles
- Policy first: decisions rely on a single source of truth
- Least privilege: agents operate with the minimum required permissions
- Auditability: every decision is traceable
- Determinism: given the same input, outputs are consistent
- Safety: human review for high risk actions
Agent Handoff and Collaboration Rules
- Planner designs the sequence and passes a plan to Implementer
- Implementer executes and passes results to Reviewer
- Reviewer validates and passes to Tester for validation
- Tester runs end-to-end tests and reports to Orchestrator
- Researcher can augment inputs from external sources when allowed
- Domain Specialist ensures domain constraints are applied before handoff
Tool Governance and Permission Rules
- Commands go through orchestrator; direct sudo-like operations are forbidden
- File edits require write access via approved adapters
- API calls require tokens from SecretsManager
- Secrets never logged; secrets rotation required
- Production changes require multi-party approval
Code Construction Rules
- Implement within adapters that enforce policy decisions
- Use idempotent operations; avoid side effects without consent
- Follow established coding standards and testing patterns
- Document decisions and rationale in code comments
Security and Production Rules
- Enforce mTLS, encryption at rest, and approved credential flow
- Maintain access audits for all policy decisions
- Enable anomaly detection and alerting on unusual policy activity
Testing Checklist
- Unit tests per agent
- Integration tests for policy evaluation and enforcement
- End-to-end tests simulating zero trust workflows
- Security and penetration tests on policy interfaces
Common Mistakes to Avoid
- Assuming a single agent suffices for zero trust posture
- Storing secrets in memory in plaintext
- Ignoring policy drift across environments
- Delayed escalation for high risk actions
- Skipping audit generation and traceability
Related implementation resources: AI Use Case for Corporate Event Managers Using Slack To Orchestrate Day-Of Venue Tasks Across Multi-Department Teams and AI Use Case for Supply Chain Consultants Using Excel To Identify Redundant Distribution Nodes for Retail Clients.
FAQ
What is the purpose of this AGENTS.md Template?
It codifies the zero trust architecture workflow for AI coding agents, defining roles, handoffs, governance, and security controls.
Who should use this template?
Developers, security engineers, platform teams, and engineering leaders implementing zero trust across apps.
What is the expected output of the agents?
Policy decisions, authorization results, posture assessments, and audit-ready logs.
How are handoffs managed between agents?
Handoffs pass a minimum viable context; the receiving agent continues with memory and source of truth from the policy store.
What are the security constraints?
No secret leakage, ephemeral credentials, least privilege, rotated keys, and encrypted data at rest.