Policy Examples
Policy Examples
Section titled “Policy Examples”This guide shows policy examples for the Agent Architecture metric. Invariants use metric keys from that metric.
Understanding Policies
Section titled “Understanding Policies”Policies in Arxo are defined in YAML and consist of invariants — conditions that must hold for the run to pass.
policy: invariants: - metric: <metric_id.key> op: <operator> value: <threshold> message: <optional_message>Operators: ==, !=, <, <=, >, >=
Metric keys are scoped (e.g. agent_architecture.overall_agent_health). See Scoring and Keys for the full list.
Agent Architecture Gate (Recommended)
Section titled “Agent Architecture Gate (Recommended)”Use Case: CI and local checks for agent reliability and governance
metrics: - id: agent_architecture
policy: invariants: - metric: agent_architecture.loop_guard_absence op: "<=" value: 0.20 message: "Agent loops must be bounded with step/time guards" - metric: agent_architecture.governance_readiness op: ">=" value: 80 message: "Tool governance baseline not met" - metric: agent_architecture.overall_agent_health op: ">=" value: 0.70 message: "Overall agent health below minimum threshold"Run:
arxo analyze --fail-fast# or with configarxo analyze --config .arxo.yamlSee Agent Architecture policy and CI gates for strict/pragmatic/no-regression profiles.
Safety and Coordination
Section titled “Safety and Coordination”Focus on safety and coordination axes:
metrics: - id: agent_architecture
policy: invariants: - metric: agent_architecture.safety_protocol_score op: ">=" value: 75 message: "Safety protocol score too low" - metric: agent_architecture.coordination_maturity_score op: ">=" value: 70 message: "Coordination maturity below threshold"Environment-Specific Policies
Section titled “Environment-Specific Policies”Use different configs per environment:
Development (.arxo.dev.yaml):
metrics: - id: agent_architecture
policy: invariants: - metric: agent_architecture.overall_agent_health op: ">=" value: 0.5 message: "Relaxed threshold for local dev"CI (.arxo.ci.yaml):
metrics: - id: agent_architecture
policy: invariants: - metric: agent_architecture.overall_agent_health op: ">=" value: 0.70 message: "Overall agent health below minimum"Usage:
arxo analyze --config .arxo.dev.yamlarxo analyze --config .arxo.ci.yamlCustom Messages
Section titled “Custom Messages”Provide actionable guidance:
policy: invariants: - metric: agent_architecture.overall_agent_health op: ">=" value: 0.70 message: | Agent architecture health is below 0.70.
Check: 1. Run: arxo analyze --format json | jq '.results[] | select(.id=="agent_architecture")' 2. Review axis scores (governance, reliability, safety, coordination) 3. See: /metrics/agent-architecture/remediation-playbookUse the MCP server to run analysis and get results; policy is enforced by the engine based on your config:
You: "Run architecture analysis and check policy"AI: [Uses analyze_architecture] "Analysis complete. No violations."See MCP Workflows and analyze_architecture.
Next Steps
Section titled “Next Steps”- Configuration Guide - Full configuration reference
- CI Integration - Enforce policies in CI
- Agent Architecture policy and CI gates - More policy patterns
- Troubleshooting - Fix violations