Policy reference (vocabulary v1)

Every field a Scopebond policy can use, for writing or reviewing a policy for a gateway, MCP proxy, framework plugin or GitHub check. Coding-agent hook users change limits with commands instead (Write a policy).

The JSON Schema ships in @scopebond/policy-schema. validatePolicy in @scopebond/verify runs the same check every gateway uses.

Document

FieldRequiredMeaning
vocabulary_versionyes"1.0"
policy_idyesStable name
versionyesPositive integer, raised on every change
clausesyesAt least one clause
assetswith money clauses{ "<ASSET>": { "decimals": n } }; amounts are whole numbers
agent_idnoThe agent it is written for

Unknown fields make a policy invalid, and an invalid replacement never takes effect.

Modes

ModeWhat happens
enforce (default when a clause names no mode)Blocks the action if the check fails
require_approvalHolds it for a single-use approval of this exact action, or denies it at the timeout
monitorLets it run and flags it. In a gateway policy, use it only for limits that cannot be checked in real time. The coding-agent hook writes every rule in this mode until you turn the rule on; its protection of Scopebond itself is always enforce

Clause types

Every clause has id, type, mode and description. Durations use ISO-8601 (P1D, PT4H). Times are UTC.

TypeFieldsUse it to
action_allowlistaction_types[], optional param_bounds (enum, min, max, pattern; arrays { items, match: "all" | "any" })Allow named actions within bounds. The usual clause
spend_limitasset, max_per_action, max_per_window, window, scope (principal | global)Cap amounts
rate_limitaction_types[], max_count, window, scopeCap frequency
endpoint_allowlist / endpoint_denylisthosts[], paths[] (glob), methods[]Limit HTTP calls
time_windowdays[], start, end, timezone (UTC)Limit when actions run
require_approvalaction_types[], approvers[] (key ids), min_approvals, timeoutRequire sign-off
sequencefirst_action_types[], then_action_types[], min_gap or forbidden_withinOrder pairs of actions
address_allowlist / address_denylist, contract_allowlistaddresses[] / contracts[] (+ selectors[]), chain_ids[]Limit on-chain destinations
oracle_conditionoracle_id, predicate, best_effort: trueDepend on outside data
key_policyactive_keys[], rotation_delay, max_key_ageGovern signing keys

How rules are applied

  • Anything outside every clause is denied. So is a value of the wrong type.
  • A value exactly at a limit is allowed.
  • A blocking result wins over approval and monitor results, whatever the clause order.
  • Only actions that ran can break a policy.
  • A global limit that cannot see every gateway's records is treated as deny.

Action types

Action typeWhat it isProduced by
shell.execEach program in a command line (program)Hook
git.pushA push, per destination branchHook
file.read, file.writeReading or writing a fileHook
mcp.tool.callAn MCP tool call (server, tool)Hook, MCP proxy
net.fetchA web fetchHook
pr.mergeMerging a pull request (paths[])GitHub check
payout.createA payment (asset, amount)Gateway, SDK, framework plugin

The hook records a tool it does not recognize as not evaluated, never as allowed. With a gateway or framework plugin, you name the action type for each tool.