Draft policy rules
/titan/management/deployments/{id}/policy/draftsDrafts typed policy rules from the customer's text with Claude, given only the text, the deployment's capabilities (ids, names, toolkits, risk and side-effect classes, operations, resource types, registered attribute names and types) and the policy's approval profile ids; never Ledger data, argument values or resource ids. The answer is parsed strictly, every name it uses is checked against the deployment, the rules are deny, or require_approval narrowed to each allow of the policy it overlaps (the allow's agents and conditions kept, so nothing refused today is let through), and are compiled with the policy in force, and the result is a suggestion of kind draft with the customer's text, listed, previewed and accepted through the suggestions routes. Nothing changes until it is accepted.
Path parameters
Headers
Bearer <token>. A Hexel Studio access token for a member or a service user of your organization (or send a service user's API key as X-API-Key).
Body parameters
Returns
200Organization-scoped result.PolicyDraftResult
Errors
- 400Invalid request: the body is not exactly {"text"} with 1-1000 characters, or the path has a query.
- 401Missing or invalid authenticated context.
- 403Organization mismatch, or the IAM action titan:policy:publish is denied.
- 404Unknown or foreign deployment; NOT_FOUND too while the caller's organization does not have policy suggestions.
- 405HTTP method is not supported on this route.
- 409The deployment is not a provisioned Titan Cloud deployment (DEPLOYMENT_NOT_PROVISIONED), is retired (DEPLOYMENT_RETIRED) or has an operation in progress (OPERATION_IN_PROGRESS).
- 413Request body exceeds its size limit.
- 415Unsupported request media type.
- 422DRAFT_REFUSED with error.message saying why: the model declined, its answer did not parse, or it named a capability, operation, resource type, attribute or approval profile the deployment does not have (for example no registered amount attribute on the refund capability), or the rules do not pass the policy checks; a require_approval that no allow of the policy overlaps; a Titan Dedicated deployment; more than 2,000 capabilities; a request the model API refuses as invalid. No rule is offered.
- 429RATE_LIMITED: the organization asked for 20 drafts in the last hour; Retry-After says when to try again.
- 502The deployment's Configuration Authority refused or answered unexpectedly (closed code).
- 503DRAFT_UNAVAILABLE when the model is not configured, unreachable, overloaded or timed out, or the deployment's capability catalog or policy layers cannot be read; local storage or the deployment's Configuration Authority unavailable.