Skip to content
Arxo Arxo

Policy Examples

This guide shows policy examples for the Agent Architecture metric. Invariants use metric keys from that metric.

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.


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:

Terminal window
arxo analyze --fail-fast
# or with config
arxo analyze --config .arxo.yaml

See Agent Architecture policy and CI gates for strict/pragmatic/no-regression profiles.


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"

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:

Terminal window
arxo analyze --config .arxo.dev.yaml
arxo analyze --config .arxo.ci.yaml

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-playbook

Use 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.