Skip to main content
The agent policy is the boundary between agents being useful and agents being safe. For every kind of change an agent can make through Datris — create a tap, run it, delete a pipeline, migrate a destination table’s column types — an administrator decides one of three things: Anything you have not set is Auto, so turning the feature on changes nothing until you set a rule. People using the Datris UI are never gated, and administrators decide the approvals. This is infrastructure, not a system prompt. An agent cannot talk its way past it, and it applies to every client — the in-platform Assistant, Claude Desktop, Cursor, the CLI, or any script holding an API key.

Enabling it

Off by default — existing installs are unchanged until you opt in.
  1. Add the flag to your .env:
  2. Recreate the Datris container:
  3. Open Configuration → Agent Policy (admins only when user authentication is on). Set the actions you care about, or click Use recommended for a starting point that pauses deletes, job kills and destination-type migrations and refuses secret, code-repository and platform-configuration writes (secret:write, code-repo:write, config:write).
The policy applies within a few seconds of saving; no restart.

What counts as an agent

Actions

The actions you can set are exactly the ones the capability model already recognizes — pipeline:create, tap:delete, job:kill, secret:write, and so on — plus three refinements: pipeline:update:dest-types, the destination column-type migration, which shares a capability with an ordinary pipeline save but rewrites a landed table; pipeline:update:codegen-scripts, which replaces the AI data-quality or AI transformation script a pipeline runs (regenerate, or restore an earlier script version) without changing its definition; and tap:run:enable-ordered, which enables and runs every tap of a catalog in dependency order as one job (one approval for the whole job). A sub-action inherits its parent’s mode unless set; resource:* sets every action on a resource. Reads, queries, searches and metadata lookups are never gated. What a key may read is governed by its capabilities. Two rules are not part of the policy and cannot be changed by it: an agent can never edit the policy, and an agent can never approve or reject an approval — whatever capabilities its key holds.

Per-resource overrides

An override tightens the policy for one pipeline or tap: tap:prices → tap:run = approve pauses runs of that one tap while every other tap runs freely. Overrides can only make an action stricter, never looser. An override can also carry a recovery mode for that resource (the Recovery select on each override). Admins can set the same value from the pipeline’s page or the tap’s test page; a benign volume signal that an incident already triaged is not re-triaged.

Approvals

Approving or rejecting a pending action is for administrators: an editor’s or viewer’s session is refused. When API keys are turned off, editors can decide approvals too. When an agent’s request hits an Approve rule, the agent receives a pending_approval response with an approval id instead of a result. The Assistant will tell you plainly that the action is waiting, and it can poll for the decision. The request itself — method, path and body, with secret-looking values masked — is shown on the approval card so you see exactly what will run. Approve, and the platform performs the original request, attributed to you (with user sign-in off, to the Datris UI’s own key). The audit log then holds two linked entries: the agent’s queued request (with the reason it gave, if any) and your approval executing it, which names the agent as the original requester. With API keys on, your approval decides whether the action runs; what the action may touch is still decided by the agent’s own access. The approved request runs with what the requesting API key may do now, or, for an in-platform chat acting for a signed-in user, with what that user may do now, and anything it creates belongs to the requester, so an agent whose key can only see what it created can see it. When the request reaches beyond that access (for example, a key that may delete pipelines in one catalog asks to delete a pipeline in another), the approval ends failed with the same refusal the agent would have got without the policy, and nothing is changed. This holds with user sign-in on or off. If you are a user limited to some catalogs, your approval instead runs within your own catalogs, as before, and anything it creates belongs to you. Two cases keep the earlier behaviour. A request made under the Datris UI’s own key without a signed-in user (with user sign-in off, that is how the in-platform chats call the platform) runs with that key’s access (held to your own catalogs if you are a user limited to some), and what it creates belongs to you, or to that key when no one is signed in. With API keys off the API is open to every caller, so an approved action runs with full access as before, held to your own catalogs if you are a user limited to some; what it creates belongs to you when user sign-in is on, and to the shared anonymous identity of the open API when it is off. With API keys on, an approval also ends failed, before anything runs, when the requester no longer exists: the requesting key was revoked or replaced by a new key under the same name, or the user whose chat asked for it was deleted. If the platform cannot check the requester or the approval at that moment (its key, user or approval store is unavailable), nothing runs and the approval ends failed with a message saying the requester could not be checked. A failed approval cannot be approved again; the agent has to request the action again. Reject, and the agent is told so on its next poll. Approvals not decided within the configured time (24 hours by default) expire on their own. An approval executes what was proposed, not what the agent would propose now: if the pipeline or tap changed in the meantime, the approval is refused as stale and the agent has to propose again. Some requests cannot be parked — file uploads, and bodies over 256 KB. If such an action is set to Approve, the agent is told to ask you to do it in the UI instead. The approval record in the database holds only a hash of the one-time value that lets the platform perform the approved request, and that hash is removed when the value is used or the approval otherwise finishes. Upgrade note (approved actions run with the requester’s access). An approved action now runs with the requester’s own access. A request for something beyond that access ends as failed instead of running. With API keys on this includes approvals already waiting when you upgrade, and one whose requesting key was revoked or replaced ends failed without running. Requests within the requester’s access run as before. Items created through an approval now belong to the requester instead of the approver, and tap scripts saved through an approval now show the requester as their author. Approvals by a user limited to some catalogs run within that user’s own catalogs as before, and what they create belongs to that user; only the check that the requester still exists is new for them. Requests made under the Datris UI’s own key, and every approval with API keys off, are unchanged. An approval requested before a change to the install’s authentication settings (API keys or user sign-in turned on or off) may end failed after the change; ask the agent to request it again. Upgrade note (approvals). When more than one server instance shares a database, stop every instance of the earlier version before starting the new one: an approval that an earlier-version instance is performing at the moment a new instance starts ends as failed, and the agent has to propose the action again.

For agents

Three MCP tools support the flow: Every mutating tool also accepts an optional reason — one line stating why the agent wants the change. It is stored in the audit log and shown on the approval card.

Limits

Recovery mode

The policy document also carries the recovery agent’s dial — recovery.mode (off / propose / autopilot) and its limits — plus per-resource recovery overrides. Every action the recovery agent takes passes through this same policy gate: under propose, everything it wants to do queues here for your approval. For a pipeline incident the one action it can take is regenerating the pipeline’s stored AI data-quality or transformation script, which is the pipeline:update:codegen-scripts action here — the Recommended template sends it for approval. The page’s Recovery panel edits mode, verifyMode and allowSchemaDriftActions — admins only, and switching to autopilot asks you to confirm — then Save recovery settings stores them without touching anything else in the policy. The thresholds in the table below (maxRecordDeltaPct through maxNullRateIncrease) are shown there and set with PUT /api/v1/policy or the Configuration assistant. The recovery block also holds the thresholds a proposed fix’s evidence is judged against, and how the fix is verified: An added column never fails a check. See Scratch-first verification for what each verdict does. GET /api/v1/policy returns recoveryRecommended, the block recommended for this install’s DATRIS_ENV label, and environmentLabel: The other fields keep the defaults above on every label; verifyMode is scratch-first everywhere. An admin can apply the recommendation with Apply recommended recovery settings on the Agent Policy page, after a confirmation that names the mode it will set. The per-resource recovery overrides are kept. The label also sets the default for threshold fields that the stored policy does not contain: a dev install falls back to 50 / true / true, every other install to the strict values. A saved policy writes every field, so after a save the stored values apply on any label. recovery.mode defaults to off on every label; the platform never switches it on by itself.
  • API Keys — what a key may do; the policy decides what it may do unattended
  • Audit Log — where queued requests, decisions and executions are recorded