Skip to content

File Format

A POLICY.md file is Markdown with YAML frontmatter. The frontmatter contains machine-enforceable rules; the Markdown body contains human-readable policy sections.

Frontmatter top-level fields

FieldRequiredTypeDescription
nameyesstringUnique policy identifier, kebab-case or snake_case.
descriptionnostringHuman-readable summary.
versionnostringSemantic version or opaque policy version.
scopenostringOne of project, skill, agent, department. Default: project.
appliesTonostring[]Agent or skill ids this policy applies to. ["all"] means every agent. Default: ["all"].
severitynostringOne of block, warn, require_approval. Default: block.
rulesnoRule[]Machine-enforceable rules.

Rule fields

FieldRequiredTypeDescription
idnostringStable rule identifier.
capabilityyesstringCapability pattern, e.g. file.write, payment.*, *.
actionyesstringallow, deny, or require_approval.
conditionnoConditionWhen the rule applies. Omit to match every intent.
reasonnostringExplanation returned to the agent/runtime.
prioritynonumberHigher number wins ties. Default: 0.
descriptionnostringHuman-readable rule note.

Capability patterns

  • Exact: file.write matches file.write.
  • Single-segment wildcard: payment.* matches payment.send, payment.refund, etc.
  • Global wildcard: * matches every capability.

Conditions

A condition is exactly one of a field test, an and group, or an or group:

yaml
condition:
  field: { path: payload.path, op: includes, value: .env }

condition:
  and:
    - field: { path: payload.amount, op: gt, value: 1000 }
    - field: { path: constraints.environment, op: eq, value: production }

condition:
  or:
    - field: { path: workerId, op: eq, value: payment-bot }
    - field: { path: specialist, op: in, values: [frontend, backend] }

Operators

eq, neq, gt, gte, lt, lte, includes, in, notIn, exists, notExists, wildcard.

Special condition paths

Conditions can reference any field the runtime provides:

  • payload.<key> - the action payload
  • constraints.<key> - execution constraints
  • requester.<key> - who is asking
  • built-ins: risk, actionType, actionClass, reversibility, capability, specialist, workerId, toolName, connectorId

Markdown body

The body is free-form Markdown for humans and LLMs. The conventional sections are:

markdown
## Forbidden
- Never commit `.env` files or any file containing secrets

## Ask first
- Adding npm dependencies
- Modifying CI/CD pipelines

## Allowed
- Running `npm run typecheck` and `npm run test`

File discovery

POLICY.md files are discovered in conventional locations:

repo-root/
  POLICY.md              # project-wide policy
  .policies/
    payment/
      POLICY.md          # named policy directory
    infra/
      POLICY.md
  .devin/skills/
    ui-polish/
      SKILL.md
      POLICY.md          # negative boundaries for one skill

Scopes stack: a skill policy can be stricter than its project policy; the runtime combines them with the most severe decision winning (deny > require_approval > allow).

Released under the Apache 2.0 License.