Skip to Content
Recodocs

AgentCore policy Cedar

When does Cedar generated from declared host authority allow send_report, and what does one policy attempt leave behind?

6 min read

What question this set answers

A policy defines what a person or agent may do independently of the proposed action. The notebook's reconciliation example uses the same distinction between reading a record and approving a consequential effect.

This set is a reusable onboarding journey for a backend engineer adding synthetic reconciliation and report features to a new service. The kit owns authority and lifecycle. This example owns the workload and configuration. The persona in every first cell is a backend engineer reusing the kit for a new service.

The notebooks follow one order. The host declares who may call which tool. A generator turns that declaration into Cedar, and a digest fingerprints the text. Later notebooks evaluate send_report for a manager, a developer, and a lookalike scope, keep a failed policy create as a failure, and check that resources carrying this set's tag are gone.

Cedar, here, answers whether a principal may perform an action on a resource. Scope is the permission label the host resolves from the verified caller, never from tool arguments. A refusal means the call is not dispatched, and the refusal is recorded. Tool arguments are not an input to generation.

How to run it

Use .venv-agentcore-policy-cedar and kernel agentcore-policy-cedar. Install the existing kit and Strands extras, and optional native SDKs, only in this environment. The README says this task changes no project dependency pins. Exact versions are in versions.json.

From the standalone recohut-kit root, use versions.json when reproducing the historical installed boundary:

uv venv --python 3.13 .venv-agentcore-policy-cedar
uv pip install --python .venv-agentcore-policy-cedar/bin/python -e '.[agentcore,codex,telemetry]' -e packages/strands nbconvert ipykernel pandas
.venv-agentcore-policy-cedar/bin/python -m ipykernel install --user --name agentcore-policy-cedar

From the recohut-labs root:

python3 ../recohut-skills/skills/agentcore-set-run/scripts/run_set.py --kit ../recohut-kit --set agentcore-policy-cedar

The runner follows the order table and retains failures. Do not replay create-once live lanes after cleanup. Inspect the recorded attempt instead.

The README names profile recohut, region us-east-1, and tag recohut-kit-agentcore=agentcore-policy-cedar. Created resources register immediately in the ignored kit ledger. The final notebook performs scoped cleanup and readback. Other tasks are preserved. The task limit is $10. Actual cost is not an observed invoice.

Every order-table row is marked AWS live, with create-once resources, bounded requests, and model scope in cells. The browser checkpoint is None on every row. Each first cell states the same call cap: one task-owned service resource, bounded requests, and no alternative model or resource recreation.

Notebooks in order

NotebookWhat it doesRecorded output
01-tool-policy-to-cedar.ipynbGenerates Cedar from declared host authority. First-cell route: scripted.yes
02-trusted-scope-parity.ipynbChecks manager and developer scope parity. Disagreement refuses dispatch. First-cell route: recorded.yes
03-validation-failure-recorded.ipynbPreserves a native policy validation failure. First-cell route: recorded.yes
04-live-policy-lifecycle.ipynbOne engine and policy attempt, with ledger registration at once and cleanup on the finally path. First-cell route: aws-live.yes
05-enforce-attach-detach-recorded.ipynbValidates ENFORCE attach and detach without changing live gateways. First-cell route: recorded.yes
06-cleanup-and-absence.ipynbVerifies task-specific policy absence for this set's tag. First-cell route: aws-live.yes

The README's observed-proof paragraph uses that same split. Notebooks 1, 2, 3, and 5 are scripted or recorded. Notebooks 4 and 6 are the aws-live notebooks. The recorded first cells add the line "recorded, not a capture of a real account."

What the recorded outputs show

The README states that six notebooks hold stored executions, with 0 error outputs and 0 unexecuted cells. Notebooks 1, 2, 3, and 5 were re-executed on 2026-10-20 with the new assertions in application.py. Notebooks 4 and 6 were not re-run in that pass. They keep their 2026-10-19 outputs.

Notebook 1 prints deterministic Cedar statements: 1 and digest 3ea1e78edcc317d8587254b591b90328b5eb24e86799b8c34e8de858ee1ed0c9, then Only trusted host Scope resolves claims; Action arguments do not grant scopes. The reading note says one statement means the declared authority for this service reduces to a single Cedar rule. The statement text is not printed, so the count and the digest are the only evidence of its content.

Notebook 2 prints send_report rows that share arguments_digest fc64b47d746c782a. The manager row, scopes kit/read and kit/manager, has kit, cedar_local, and gateway all allow, agree True, and dispatch_allowed True. The developer row with kit/read has deny in all three columns, agree True, and dispatch_allowed False. The reading note says the developer with kit/read and kit/notmanager was denied in all three columns as well. It says the gateway value is a recorded input, not a decision observed from a live gateway. Every stored row shows agree True, so no disagreement case is printed. The rule named there is Gateway disagreement refuses dispatch.

Notebook 3 prints native validation failure preserved: CREATE_FAILED and recorded, not a capture of a real account. The reading note says the status was kept as received. The notebook text says this is the only path replayed: the service rejects the policy, the kit keeps CREATE_FAILED, and the policy stays unenforced.

Notebook 4 prints live policy blocked: ValidationException ValidationException and policy resource cleanup verified: True. The reading note says a ValidationException was raised at a create step the line does not name, so no policy is shown as enforced, and that cleanup read back as complete. The README summary says the live policy lifecycle rejected ValidationException, that there was one policy-engine attempt, no model calls, and that own resources are absent.

Notebook 5 prints an attached record, a detached record, recorded, not a capture of a real account, and Live attach blocked: no task-owned Gateway execution role remains; create-once runtime role was deleted. The attached record shows gateway …abcdefghij, status READY, policy engine …efghij, mode ENFORCE, and other_fields_unchanged True. The detached record shows the same gateway, an empty policy engine, mode None, and other_fields_unchanged True. The reading note says the identifiers are shortened placeholders and that the lines show the shape of a reversible attach.

Notebook 6 prints no tagged resources remain for agentcore-policy-cedar. The reading note calls that line the receipt: the tag query for this task's tag returned nothing, so tagged policy engines and tagged roles for this set are absent. The notebook text says this is step six of six, after the recorded attach and detach notebook, and that the check covers whatever the live lifecycle notebook registered in the ledger.

The README states the cross-notebook result in one sentence: the manager is permitted, the developer and the lookalike are denied, and a policy disagreement or error refuses dispatch. It also says the verified OAuth scope is host-owned, never Action arguments.

What is not shown or not run

Notebook 1 does not print the Cedar statement. Notebook 2 does not print a row where agree is false, and its gateway column is not an observed live gateway decision. Notebook 3 does not print the reason text behind CREATE_FAILED. Notebook 4 does not name the create step, does not explain why ValidationException appears twice, and does not print resource identifiers. A finally path does not run if the process is killed.

Notebook 5 says no live attach was made: no task-owned Gateway execution role remains, and the create-once runtime role was deleted. The reading note says live scoped enforcement stays unverified. The README says live scoped Cedar enforcement is unverified, the service validation failure is retained, and there is no second engine or gateway.

Notebook 6 speaks only about resources that carry this set's tag. It does not speak about untagged resources or other tasks. The README says other tasks are preserved, and that actual cost is not an observed invoice.

Notebooks 4 and 6 were not re-run on 2026-10-20. The optional "Try it yourself" notes have no saved output. Notebook 1 says none of those probes should be run against live resources, and that nothing later depends on them.

Where it fits in the kit

Every code cell has the same shape: import application as app, then app.notebook_01() through app.notebook_06(). No other module is imported in those cells. The README assigns authority and lifecycle to the kit, and the workload and configuration to this example. The 2026-10-20 re-execution used new assertions in application.py. The install command names the extras agentcore, codex, and telemetry, plus packages/strands, nbconvert, ipykernel, and pandas. Those are install targets in the README, not further imports in the notebooks.

How is this page?

Last updated on