Skip to content
Documentation menu

Core concepts · 06

Policies

A policy is the authored, versioned statement of what an agent may do. It is reusable across agents, and every decision records exactly which policy version made it.

Anatomy of a policy

policy · v14 · illustrative

# illustrative · authored visually or from a template
default: reject                    # the safe default
actions:
  - allow: repo.read_file, repo.deploy
    where: repo in [keydris/api], branch in [main]
  - allow: mcp.call_tool
    where: server in [internal-tools]
  - allow: slack.read_history
    where: channel in [#deploys]
  - require_approval: crm.export_contacts
# unmatched or unsupported action types are rejected
  • Rules name governed actions and carry one of three decisions: ALLOW, REJECT, or APPROVAL REQUIRED (written allow, reject, and require_approval in the policy above).
  • Conditions scope a rule: the resource, repository, branch, channel, MCP server or provider it applies to, and, in a limited form, the environment. A condition can also bind a vault credential the action must use. The credential itself is never exposed to the policy or the agent.
  • The default decision catches everything no rule matches. Reject-by-default is the pattern these docs assume everywhere.

Composition and safety rules

Verified behavior

When rules overlap, the most restrictive matching outcome wins. Action types Keydris doesn't support are rejected, never implicitly allowed. And an agent cannot select a policy: the one an operator assigned is the one that governs it.

Preview and lint a policy before relying on it: the builder shows a plain-English summary of what you've authored, and flags rules that can never match or that conflict.

Looking to stop a running agent rather than change its rules? That's revocation, not policy editing. See KITs & devices.

Versioning and attribution

Saving a policy compiles it to a versioned, enforceable module. The version matters for evidence: every audit record names the policy version that decided it, so a decision from last March is judged by the policy as it stood last March, not as it stands today.

Note

One policy can govern many agents, and assignment is central: connect an agent once, then create, update, or reassign its policy from Keydris. None of it requires touching the agent's CLI setup. Every agent governed by a changed policy follows the new version at its next evaluation, version history preserved.