Access policy stays out of the tool definition. This page shows where each kind of rule goes, and what to watch for when a profile overrides a default.
Where a policy goes
Access policy lives on the profile side. A tool under tools: holds only its usage and its authentication. Rules that allow, deny or hold a call live in policy_defaults and profiles.<profile>.policy. The gateway refuses to start on a policy key on a tool, and the error names the place to put it.
| What | Where |
|---|---|
| CLI rules | policy_defaults.<tool>.cli or profiles.<p>.policy.<tool>.cli |
| Argument rules | policy_defaults.<tool>.args or the profile equivalent |
| Strong approval | require_strong: true on the policy entry |
An entry has the shape {cli, args, require_strong} and works for any tool type. The key is the name from the tool config, such as gh or send, not the exposed name with its namespace. Flag arity (value_flags, boolean_flags) is set on the cli_passthrough tool.
CLI policy
tools:
- type: cli_passthrough
name: kubectl
description: kubectl for dev only
command: kubectl
policy_defaults:
kubectl:
cli:
allow_subcommands: [get, describe, logs]
require_args: ["--namespace=dev"]Argument policy
tools:
- type: http
namespace: pay
name: send
description: Send a payment
method: POST
url: https://pay.example.com/send
params:
- name: amount
in: body
required: true
policy_defaults:
send:
args:
rules:
- name: big-payment
when: { path: amount, gt: 100 }
action: approvalThe rule reads the call arguments, so the tool must declare the parameter it tests. An http tool sends only declared params, and in: body puts amount in the JSON body. A call with {"amount": 40} runs; {"amount": 250} is held for approval.
A denial reads Denied by policy.args_policy.<rule>.
Strong approval
server:
consent:
rp_id: example.com
origin: https://splicedock.example.com
hardware_roots:
- |
-----BEGIN CERTIFICATE-----
...vendor attestation root for your key model...
-----END CERTIFICATE-----
policy_defaults:
gh:
cli:
allow_subcommand_paths: [[repo, delete]]
approval_subcommand_paths: [[repo, delete]]
require_strong: trueserver.consent holds the WebAuthn settings (rp_id, an HTTPS origin and the hardware_roots of your key model; a restart applies changes). The policy must also route the call to approval, here with approval_subcommand_paths. Enrol a key once at /api/v1/webauthn/enroll. A pending strong approval is confirmed on a consent link: the approvals page has a get consent link button on each strong card.
A profile entry replaces the default whole
Resolution, most specific first: the stored override for the tool and profile, the stored override for all profiles, profiles.<p>.policy.<tool>, then policy_defaults.<tool>. The first one found wins and nothing is merged. A profile entry that only sets args drops the default cli rules and require_strong. Repeat every part the profile should keep.
policy_defaults:
gh:
cli:
deny_subcommands: [repo]
require_strong: true
profiles:
reader:
tools: ["gh__*"]
policy:
gh:
cli:
deny_subcommands: [repo]
require_strong: trueProfiles stored by an earlier deployment
A stored manifest from an earlier deployment may carry a credentials block, which a profile no longer has. At start-up the gateway removes that key from every stored manifest once, before the catalog loads. Comments in a migrated manifest are lost and the revision goes up by one. A manifest that is still invalid for another reason is left unchanged and logged as not migrated.
Admin API
GET, PUT and DELETE /api/v1/policies/:name (with ?profile=) take and return the access policy shape. The PUT body is {"policy": {"cli": {...}}}. Dry-run accepts a full entry or a bare cli policy.
A stored override that holds a flat CLI policy is read as {cli: ...}.