Bounded Autonomy: Policy Engine
Builders who have a working workflow agent and are ready to add Cedar policy guardrails. If you're still picking a pattern, start with the workflow overview.
The single most important differentiator for production workflow agents. Without policy enforcement, an agent with access to infrastructure tools is a liability. With it, the agent operates within a provable boundary.
Why This Matters
Without bounded autonomy, you get one of two outcomes:
- Over-permissive agents that can cause outages when they make mistakes
- Under-permissive agents that require human approval for every action, defeating the purpose of automation
Cedar policies let you precisely define the boundary. The agent reasons freely within its allowed actions, and the platform prevents it from exceeding them, regardless of what the LLM decides. Deny always wins over permit — multiple policies compose safely, and an explicit forbid overrides any permit.
Capabilities
| Capability | Detail |
|---|---|
| Tool-level access control | Allow or deny specific tools based on Cedar policies. |
| Combined schema size | The Cedar schema generated from a policy engine's associated gateways is capped at 400 KB, driven by tool count and input-parameter complexity rather than policy count. Gateways with a very large or complex tool catalog may need a dedicated policy engine. See the AgentCore limitations reference. |
| Condition-based enforcement | Restrict tool use based on request context (time, entity type, priority). |
| LOG_ONLY vs ENFORCE modes | Start with LOG_ONLY to observe decisions; switch to ENFORCE for production. |
| Audit trail | Every policy evaluation is logged with full context in CloudWatch. |
| Multi-policy composition | Combine multiple policies. Deny always wins over permit. |
Autonomy Risk Classification
Before writing policies, classify each action's risk level using the Agentic AI Security Scoping Matrix. This gives you a systematic basis for deciding which actions need condition-based gating, human approval, or time-windowing.
Example: Priority-Based Autonomy
// High-priority incidents: allow remediation actions
permit(
principal is AgentCore::OAuthUser,
action == AgentCore::Action::"RemediationTools___restart_service",
resource == AgentCore::Gateway::"arn:aws:bedrock-agentcore:us-west-2:123456789012:gateway/incident-gateway"
)
when {
context.input.priority == "HIGH"
};
// Low-priority: only allow read-only diagnostic tools
permit(
principal is AgentCore::OAuthUser,
action == AgentCore::Action::"DiagnosticTools___get_metrics",
resource == AgentCore::Gateway::"arn:aws:bedrock-agentcore:us-west-2:123456789012:gateway/incident-gateway"
)
when {
context.input.priority == "LOW"
};
Policy Design Patterns
| Pattern | Description | Example |
|---|---|---|
| Priority-gated | Different tool access based on event severity | HIGH = remediate, LOW = diagnose only |
| Time-windowed | Allow destructive actions only during maintenance windows | Restarts only between 2-4 AM UTC |
| Entity-scoped | Restrict actions to specific resource types or namespaces | Only restart services in staging namespace |
| Escalation ladder | Auto-execute low-risk, require approval for high-risk | Auto-restart → human-approve failover |
| Read-first, act-on-confirm | Agent can read anything, but write actions need policy permit | Get metrics freely; restart needs explicit permit |
LOG_ONLY vs ENFORCE
Start in LOG_ONLY mode to understand your agent's decision patterns before constraining it:
- LOG_ONLY — Policies are evaluated but not enforced. Violations are logged but the agent proceeds. Use during development and initial production deployment to build confidence.
- ENFORCE — Policies are evaluated and enforced. The agent cannot exceed its permitted actions. Switch to this once you've validated the policy set against real traffic.
Policy evaluation logs in CloudWatch show every evaluation decision — use them during the LOG_ONLY phase to identify gaps before switching to ENFORCE.
Deployment Workflow
- Classify risk — Use the Agentic AI Security Scoping Matrix to determine which actions need conditions or human approval.
- Define policies — Write Cedar policies that match your organization's autonomy boundaries.
- Deploy in LOG_ONLY — Observe the agent's behavior against real events. Review policy evaluation logs.
- Tune policies — Adjust based on false positives (blocking legitimate actions) and false negatives (allowing unintended actions).
- Switch to ENFORCE — Once satisfied, flip to enforcement mode. The agent is now bounded.
- Iterate — As you add new tools or domains, add corresponding policies before granting access.
Further Reading
- Cedar policy authorization flow — how deny-wins composition works
- Policy Engine getting started — LOG_ONLY, ENFORCE, and first policy setup
- Observability and policy evaluation logging
- Agentic AI Security Scoping Matrix — autonomy risk classification
- AWS Well-Architected Agentic AI Lens