---
title: "The Cedar a preset compiles to (Feature 6 Phase B)"
method: POST
path: "/v1/agents/{agent_id}/policy-preset/cedar"
tags: ["Policies"]
---

# The Cedar a preset compiles to (Feature 6 Phase B)

`POST /v1/agents/{agent_id}/policy-preset/cedar`

## Request

- Base URL: `https://api.1claw.co`
- URL: `https://api.1claw.co/v1/agents/{agent_id}/policy-preset/cedar`
- Auth: HTTP bearer

Returns the Cedar policy text a preset produces for this agent, already
validated against the deployed Cedar schema. **Read-only — it creates no
policy.** The wizard's Advanced tab shows this before anything is written.

**The text is not the whole policy.** The presets denominate limits in USD
("$100 a day", "ask above $25") and the Cedar schema exposes transaction
value only as `value_gwei`, a native-token amount. Converting needs a live
price, and a price baked into policy text is wrong the moment it is written
and stays wrong silently — so the compiler does not convert. The USD limits
come back in `residual_guardrails`, still enforced by the agent's guardrail
columns where a live price is applied at evaluation time.

A UI must show `residual_guardrails` alongside the text. Presenting the
Cedar alone would read as complete while permitting every amount.

Policies are created in **shadow** mode: they report what they would decide
without deciding it, until an operator promotes them.

## Path parameters

- `agent_id` string, uuid, required

## Request body

- object
  - `preset` string, required

## Response `200`

Generated Cedar plus the limits it cannot carry

- object
  - `preset` string
  - `agent_id` string, uuid
  - `cedar` string: Cedar text, validated against the deployed schema.
  - `residual_guardrails` string[]: Limits Cedar cannot express, still enforced by guardrails. Show these next to the text.
  - `enforcement_mode` 'shadow'
  - `ir` object: Intermediate representation, so a caller can render a different policy backend without re-deriving the preset.
    - `preset_slug` string
    - `permit_actions` string[]
    - `forbid_actions` string[]
    - `secret_paths` string[]
    - `residual_guardrails` string[]

## Other responses

- `403`: Insufficient permissions
- `404`: Resource not found

---

[API](https://skmtc.dev/1claw/apis/1claw-api.md) · [All operations](https://skmtc.dev/1claw/apis/1claw-api/llms.txt) · [OpenAPI document](https://skmtc.dev/1claw/apis/1claw-api/revisions/5fa0918f3b41?raw)
