appendix C Cedar authorization with OpenClaw agents
This appendix turns the authorization ideas from the earlier chapter into working examples using OpenClaw agents and a Cedar policy decision point. It is meant to make policy behavior visible during agent execution, planning, and delegation, with the demos designed to be run in order so each one builds on the last. The setup relies on a local demo repository, Python, Jupyter, and a running Cedar PDP that the agent consults while acting.
The first demonstration shows reactive authorization: the agent proposes tool calls, the policy layer checks each one before execution, and Cedar returns permit or deny decisions in real time. Allowed actions proceed normally, while denied actions are blocked and fed back into the agent’s reasoning so it can explain the limitation and replan. This illustrates that authorization is not just a gate but part of the agent’s feedback loop, though it also shows the limitation that the agent only learns boundaries after trying them.
The second demonstration improves on that by letting the agent query policy constraints before acting, so it can plan within the rules instead of discovering them through failure. Cedar returns residual policy expressions that describe what is still allowed or forbidden, and the agent uses those results to choose valid file locations or avoid protected paths altogether. The third demonstration treats delegation as structured data: a main agent grants a subagent a narrowly scoped authority record, and policies enforce that the subagent can act only within the delegated actions, resources, and time limits. Together, the demos show authorization as something that shapes agent behavior throughout the full lifecycle of action, planning, and collaboration.
C.6 Wrapping up
The demonstrations in this appendix illustrate how authorization evolves as systems become more dynamic and agent driven.
In the first demo, authorization functions as a reactive control. The agent proposes actions, the policy system evaluates them, and the agent then adapts based on the results.
In the second demo, authorization serves as a source of guidance. By querying policy constraints during planning, the agent can develop strategies that stay within defined boundaries, reducing trial-and-error behavior.
In the third demo, authorization governs collaboration. Delegation is represented as structured data, and policies ensure that subagents operate only within the authority explicitly granted to them.
Across all three examples, the same architectural pattern holds. Authorization decisions are made by a policy engine, informed by structured inputs, and enforced consistently at runtime. What changes is how those decisions are applied: first as a gate, then as a guide, and finally as a mechanism for safely distributing authority.
These patterns illustrate the central idea of chapter 18: in agentic systems, authorization is not just about controlling access. It becomes integral to how agents plan, act, and work together within clearly defined and enforceable boundaries.
FAQ
What is the main purpose of appendix C in Authorization in Action?
It provides hands-on demonstrations of the authorization patterns introduced in chapter 18, showing how Cedar policies shape agent behavior during execution, planning, and delegation.What tools and components are used in the demos?
The demos use OpenClaw, an open-source framework for tool-using language model agents, together with a lightweight Cedar policy decision point (PDP).What are the three demonstrations in appendix C?
The appendix includes: 1) reactive authorization, 2) constraint-aware planning, and 3) delegation as data.How do the demos relate to chapter 18?
They correspond directly to section 18.3 (policy-aware agent loop), section 18.4 (policy constraints guiding planning), and section 18.6 (delegation and subagents).What is the difference between reactive authorization and constraint-aware planning?
Reactive authorization checks tool calls at runtime and responds with permit or deny decisions. Constraint-aware planning queries policy before acting, so the agent can avoid disallowed actions in advance.What happens when a tool call is denied in the reactive authorization demo?
The tool execution is blocked, the agent receives structured denial feedback, and the agent can replan and adjust its response instead of stopping entirely.What is the role of the policy residuals in the constraint-aware planning demo?
Policy residuals describe the remaining constraints after partial evaluation. The agent uses them to understand what is allowed before attempting an action.Why does the delegation demo use a notebook and test script instead of a full OpenClaw gateway workflow?
A full end-to-end delegation setup would require a running OpenClaw gateway and real subagent sessions created viasessions_spawn, which is more complex than the demo environment. The notebook and test script isolate the authorization behavior and show how delegation data affects decisions.
Authorization in Action ebook for free