Skip to content

MCP Tools Reference

77 tools — 4 core state · 7 branching/speculation · 10 query/blame/explore · 4 namespaces · 7 epochs · 4 sessions · 4 maintenance (GC and history) · 10 plans/tasks · 12 policy · 8 taint · 7 reminders. Also available as HTTP REST endpoints via --http mode. The agentstategraph-mcp binary additionally offers a migrate subcommand for schema upgrades — it’s a one-shot CLI, not an MCP tool.

Namespace override: the 17 ref-touching tools (get, set, delete, branch, list_branches, merge, log, diff, speculate, query, blame, list_paths, get_tree, search, stats, commit_graph, intent_tree) also accept an optional namespace field that overrides the server’s configured namespace for that call. See Namespaces.

Read a value from state at any branch, tag, or commit.

Parameters:

NameTypeRequiredDefaultDescription
refstringno"main"Branch, tag, or commit ID
pathstringyesJSON path (e.g., /nodes/0/status). Use / for entire state.

Example input:

{ "ref": "main", "path": "/cluster/name" }

Example output:

"prod"

Write a value to state, creating a new atomic commit with intent metadata.

Parameters:

NameTypeRequiredDefaultDescription
refstringno"main"Branch to commit to
pathstringyesJSON path to set
valueanyyesJSON value to write
intent_categorystringyesExplore, Refine, Fix, Rollback, Checkpoint, Merge, Migrate, Plan, Taint, Untaint, Quarantine, Unquarantine, Watch, Unwatch, PolicyPropose, PolicyRatify, PolicySupersede, PolicySign, or Custom:<value>
intent_descriptionstringyesWhy this change is being made
reasoningstringnoAgent’s chain-of-thought
confidencenumbernoSelf-assessed confidence (0.0-1.0)
tagsstring[]noQueryable tags

Example input:

{
"path": "/cluster/replicas",
"value": 3,
"intent_category": "Refine",
"intent_description": "Scale to 3 replicas",
"reasoning": "Traffic increased 40% over last hour",
"confidence": 0.85,
"tags": ["scaling", "auto"]
}

Example output:

Committed: a1b2c3d4

Remove a value from state, creating a new commit.

Parameters:

NameTypeRequiredDefaultDescription
refstringno"main"Branch
pathstringyesJSON path to delete
intent_categorystringyesIntent category
intent_descriptionstringyesWhy this deletion

Example input:

{
"path": "/cluster/deprecated_config",
"intent_category": "Fix",
"intent_description": "Remove deprecated config field"
}

Example output:

Deleted and committed: e5f6g7h8

Create a new branch from any ref. Supports namespaced names.

Parameters:

NameTypeRequiredDefaultDescription
namestringyesBranch name (supports / namespacing)
fromstringno"main"Ref to branch from

Example input:

{ "name": "agents/planner/workspace", "from": "main" }

Example output:

Branch 'agents/planner/workspace' created at a1b2c3d4

List all branches, optionally filtered by namespace prefix.

Parameters:

NameTypeRequiredDefaultDescription
prefixstringnoNamespace prefix filter

Example input:

{ "prefix": "agents/" }

Example output:

2 branches:
agents/planner/workspace -> a1b2c3d4
agents/executor/workspace -> e5f6g7h8

Merge source branch into target. Uses schema-aware merge. Returns conflicts if auto-resolution fails.

Parameters:

NameTypeRequiredDefaultDescription
sourcestringyesBranch to merge from
targetstringno"main"Branch to merge into
intent_descriptionstringyesWhy this merge
reasoningstringnoReasoning for merge

Example input:

{
"source": "feature/new-network",
"target": "main",
"intent_description": "Adopt flannel network config",
"reasoning": "Lower overhead than calico in benchmarks"
}

Example output (success):

Merged 'feature/new-network' into 'main': i9j0k1l2

Example output (conflict):

CONFLICTS (1):
[
{
"path": "/cluster/network/dns",
"base": "8.8.8.8",
"ours": "1.1.1.1",
"theirs": "9.9.9.9"
}
]

Structured diff between two refs. Returns typed DiffOps, not text diffs.

Parameters:

NameTypeRequiredDefaultDescription
ref_astringyesFirst ref
ref_bstringyesSecond ref

Example input:

{ "ref_a": "main", "ref_b": "feature/v2" }

Example output:

2 changes:
[
{ "op": "SetValue", "path": "/app/version", "value": "2.0" },
{ "op": "AddKey", "path": "/app/features/dark-mode", "value": true }
]

Namespaces give each project its own set of branches. Branches in different namespaces can share names, and listing one namespace’s branches doesn’t show another’s. They share the store’s commits, so they aren’t a security boundary, and MCP tools can work in any namespace. See the Namespaces guide for the full model.

Create a namespace (idempotent).

Parameters:

NameTypeRequiredDefaultDescription
namestringyesNamespace name (alphanumeric + -_, max 64 chars)

Example output:

Namespace 'acme' created

List all namespaces in the repository.

Parameters: None.

Example output:

["default", "acme", "globex"]

Delete a namespace and all of its refs. Cannot delete default. Irreversible.

Parameters:

NameTypeRequiredDefaultDescription
namestringyesNamespace to delete

Example output:

Namespace 'globex' deleted (12 refs removed)

Merge a branch from another namespace into a branch in the active namespace. Always refused for now: the policy check that would allow it isn’t built yet.

Parameters:

NameTypeRequiredDefaultDescription
source_namespacestringyesNamespace to merge from
source_branchstringyesBranch in the source namespace
target_branchstringno"main"Branch in the active namespace to merge into
intent_descriptionstringyesWhy this cross-namespace merge

Example output:

Error: cross-namespace merge denied: no PolicyStore configured

Create a lightweight speculation from a ref. O(1) creation.

Parameters:

NameTypeRequiredDefaultDescription
fromstringno"main"Ref to speculate from
labelstringnoHuman-readable label

Example input:

{ "from": "main", "label": "try-ceph-storage" }

Example output:

Speculation created: handle_id=1 (from 'main', label: "try-ceph-storage")

Modify state within a speculation. Changes are isolated until committed.

Parameters:

NameTypeRequiredDefaultDescription
handle_idnumberyesSpeculation handle ID
operationsarrayyesArray of {op, path, value?}

Each operation has:

  • op: "set" or "delete"
  • path: JSON path
  • value: required for "set"

Example input:

{
"handle_id": 1,
"operations": [
{ "op": "set", "path": "/storage/type", "value": "ceph" },
{ "op": "set", "path": "/storage/replicas", "value": 3 },
{ "op": "delete", "path": "/storage/legacy" }
]
}

Example output:

Applied 3 operations to speculation 1

Compare multiple speculations. Returns diffs showing how each diverges from base.

Parameters:

NameTypeRequiredDefaultDescription
handle_idsnumber[]yesSpeculation handle IDs to compare

Example input:

{ "handle_ids": [1, 2] }

Example output:

[
{
"handle": 1,
"label": "try-ceph",
"changes": 2,
"diff": [
{ "op": "SetValue", "path": "/storage/type", "value": "ceph" },
{ "op": "SetValue", "path": "/storage/replicas", "value": 3 }
]
},
{
"handle": 2,
"label": "try-nfs",
"changes": 1,
"diff": [
{ "op": "SetValue", "path": "/storage/type", "value": "nfs" }
]
}
]

Promote a speculation to a real commit on its base branch. Before promoting, the speculation’s diff is evaluated against policy, with tokens inferred from it (destructive, schema-change, ref-rewrite, large, reindex, migration):

  • Allow → promoted, and the speculation is consumed.
  • Deny or RequireApproval → not promoted; the decision JSON is returned.
  • No policy matched, and the change has tokens → the server’s fail-safe decides. Under deny (the default) it isn’t promoted, and the response names the tokens. Ratify a policy whose triggers include the token and that allows promote_speculation, or start the server with --policy-fail-safe allow.
  • No policy matched, and the change has no tokens → promoted.

A speculation that isn’t promoted stays open to change, retry or discard.

Parameters:

NameTypeRequiredDefaultDescription
handle_idnumberyesSpeculation handle ID
intent_categorystringyesIntent category
intent_descriptionstringyesWhy this approach was chosen
reasoningstringnoReasoning
confidencenumbernoConfidence (0.0-1.0)

Example input:

{
"handle_id": 2,
"intent_category": "Checkpoint",
"intent_description": "Use NFS storage",
"reasoning": "Only 2 nodes available, Ceph needs 3+",
"confidence": 0.9
}

Example output:

Speculation committed: m3n4o5p6

Example output (refused by the fail-safe):

{
"original": { "kind": "no_policy_match" },
"translated": {
"kind": "deny",
"matched_policy": "<fail-safe:deny>",
"reason": "no policy covers this change's tokens (destructive); fail-safe deny applied at MCP layer"
},
"fail_safe": "deny",
"tokens": ["destructive"]
}

Discard a speculation. All changes freed immediately.

Parameters:

NameTypeRequiredDefaultDescription
handle_idnumberyesSpeculation handle ID

Example input:

{ "handle_id": 1 }

Example output:

Speculation 1 discarded

List commits with full intent, reasoning, and metadata.

Parameters:

NameTypeRequiredDefaultDescription
refstringno"main"Branch or ref
limitnumberno10Max commits to return

Example input:

{ "ref": "main", "limit": 3 }

Example output:

[
{
"id": "a1b2c3d4",
"agent": "mcp-agent",
"intent": {
"category": "Refine",
"description": "Scale to 3 replicas",
"tags": ["scaling"]
},
"reasoning": "Traffic increased 40%",
"confidence": 0.85,
"parents": 1,
"timestamp": "2026-04-06T12:00:00Z"
}
]

Query commits with composable filters. All filters are AND-combined.

Parameters:

NameTypeRequiredDefaultDescription
refstringno"main"Branch to query
agent_idstringnoFilter by agent
intent_categorystringnoFilter by category
tagsstring[]noFilter by tags (all must match)
authority_principalstringnoFilter by authority
reasoning_containsstringnoFull-text search in reasoning
confidence_minnumbernoMinimum confidence
confidence_maxnumbernoMaximum confidence
has_deviationsbooleannoOnly results with deviations
limitnumberno20Max results

Example input:

{
"agent_id": "agent/scaler",
"intent_category": "Refine",
"confidence_min": 0.8,
"limit": 5
}

Example output:

[
{
"id": "a1b2c3d4",
"agent": "agent/scaler",
"intent": {
"category": "Refine",
"description": "Scale to 3 replicas",
"tags": ["scaling"]
},
"reasoning": "Traffic increased 40%",
"confidence": 0.85,
"timestamp": "2026-04-06T12:00:00Z"
}
]

Find which commit last modified a value at a path and why.

Parameters:

NameTypeRequiredDefaultDescription
refstringno"main"Branch
pathstringyesPath to blame

Example input:

{ "path": "/cluster/replicas" }

Example output:

{
"commit_id": "a1b2c3d4",
"agent": "agent/scaler",
"intent": {
"category": "Refine",
"description": "Scale to 3 replicas"
},
"reasoning": "Traffic increased 40%",
"confidence": 0.85,
"timestamp": "2026-04-06T12:00:00Z"
}

Create a new epoch to group related work.

Parameters:

NameTypeRequiredDefaultDescription
idstringyesEpoch ID (e.g., "2026-04-incident-node3")
descriptionstringyesDescription
root_intentsstring[]yesRoot intent IDs that define this epoch

Example input:

{
"id": "2026-04-incident-node3",
"description": "Node3 failure recovery",
"root_intents": ["intent-001", "intent-002"]
}

Example output:

Epoch '2026-04-incident-node3' created (status: Open)

Seal an epoch, making it read-only and tamper-evident. Cannot be undone.

Parameters:

NameTypeRequiredDefaultDescription
idstringyesEpoch ID
summarystringyesFinal summary

Example input:

{
"id": "2026-04-incident-node3",
"summary": "Node3 recovered. Replicas restored to 3. No data loss."
}

Example output:

Epoch '2026-04-incident-node3' sealed

List all epochs with their status, dates, and commit counts.

Parameters: None.

Example output:

[
{
"id": "2026-04-incident-node3",
"description": "Node3 failure recovery",
"status": "Sealed",
"commits": 12,
"agents": ["agent/monitor", "agent/recovery"],
"tags": ["incident", "node3"],
"created": "2026-04-06T10:00:00Z",
"sealed": "2026-04-06T11:30:00Z"
}
]

Transition a sealed epoch to Archived (cold storage; still queryable).

Parameters:

NameTypeRequiredDefaultDescription
idstringyesEpoch ID (must be sealed)

Example output:

Epoch '2026-04-incident-node3' archived

Export a sealed or archived epoch as a self-contained JSON audit bundle (the epoch plus full commit records). Active epochs cannot be exported.

Parameters:

NameTypeRequiredDefaultDescription
idstringyesEpoch ID (sealed or archived)

Example output:

{
"agentstategraph_export_version": 1,
"epoch": { "id": "2026-04-incident-node3", "status": "Sealed", "seal_hash": "..." },
"commits": [ /* full Commit records */ ],
"exported_at": "2026-05-25T10:00:00Z"
}

Set the active epoch for this server. Subsequent commits are associated with it.

Parameters:

NameTypeRequiredDefaultDescription
idstringyesEpoch ID to enter

Clear the active epoch.

Parameters: None.


Create a new agent session, optionally scoped to a namespace and/or a path subtree.

Parameters:

NameTypeRequiredDefaultDescription
agent_idstringyesAgent identity for the session
branchstringno"main"Working branch
parent_sessionstringnoParent session id (for sub-agent orchestration)
delegated_intentstringnoIntent this session was delegated
path_scopestringnoRestrict the session to a path subtree
namespace_idstringnoNamespace to scope the session to

Example output:

Session 'session-002' created for 'agent/executor'

Set the active session for this server.

Parameters:

NameTypeRequiredDefaultDescription
idstringyesSession id to enter

Clear the active session.

Parameters: None.


List active agent sessions with parent-child relationships and path scoping.

Parameters:

NameTypeRequiredDefaultDescription
agent_idstringnoFilter by agent

Example input:

{ "agent_id": "agent/planner" }

Example output:

[
{
"id": "session-001",
"agent": "agent/planner",
"branch": "agents/planner/workspace",
"parent_session": null,
"delegated_intent": "intent-001",
"report_to": "user",
"path_scope": "/cluster",
"created": "2026-04-06T12:00:00Z"
}
]

List all leaf paths in the state tree under a prefix. Use to explore what data exists.

Parameters:

NameTypeRequiredDefaultDescription
refstringno"main"Branch or ref
prefixstringno"/"Path prefix to list under
max_depthnumberno50Max tree depth to traverse

Example input:

{ "ref": "main", "prefix": "/cluster" }

Example output:

6 paths:
/cluster/name
/cluster/region
/cluster/nodes/0/hostname
/cluster/nodes/0/status
/cluster/network/topology
/cluster/config/log_level

Get an entire subtree as nested JSON. Efficient batch alternative to reading individual paths.

Parameters:

NameTypeRequiredDefaultDescription
refstringno"main"Branch or ref
prefixstringno"/"Path prefix to get subtree for

Example input:

{ "ref": "main", "prefix": "/cluster/network" }

Example output:

{
"topology": "mesh",
"subnet": "10.0.0.0/24",
"dns": "1.1.1.1"
}

Search state values and key names for a query string. Case-insensitive.

Parameters:

NameTypeRequiredDefaultDescription
refstringno"main"Branch or ref
querystringyesSearch query (matches values and key names)
max_resultsnumberno50Max results to return

Example input:

{ "query": "mesh" }

Example output:

[
{ "path": "/cluster/network/topology", "value": "mesh" }
]

Get summary statistics for a ref. Useful for dashboard displays.

Parameters:

NameTypeRequiredDefaultDescription
refstringno"main"Branch or ref

Example output:

{
"commit_count": 47,
"branch_count": 5,
"path_count": 23,
"epoch_count": 2,
"agents": ["agent/monitor", "agent/planner", "agent/setup"],
"categories": ["Checkpoint", "Explore", "Fix", "Merge", "Refine"],
"latest_commit": {
"id": "sg_f5b2..17",
"agent": "agent/compliance",
"intent": "Seal Q1 epoch",
"timestamp": "2026-04-10T14:33:00Z"
}
}

Get the commit DAG for visualization. Returns nodes with parents, agent, category, and timestamps.

Parameters:

NameTypeRequiredDefaultDescription
refstringno"main"Branch or ref
depthnumberno50Max commits to include

Example output:

[
{
"id": "sg_f5b2..17",
"full_id": "sg_f5b2c39e...",
"parents": ["sg_d1e8..9a"],
"agent": "agent/compliance",
"category": "Checkpoint",
"description": "Seal Q1 epoch",
"confidence": 0.99,
"timestamp": "2026-04-10T14:33:00Z",
"is_merge": false
}
]

Get the intent decomposition tree. Shows how intents are broken down into sub-tasks across agents.

Parameters:

NameTypeRequiredDefaultDescription
refstringno"main"Branch or ref
root_commit_idstringnoOptional root commit ID to start from

Example output:

{
"roots": [
{
"id": "sg_6c0d..78",
"agent": "agent/setup",
"category": "Checkpoint",
"description": "Initialize cluster",
"confidence": 0.99,
"children": [
{
"id": "sg_7d1c..56",
"agent": "agent/setup",
"category": "Checkpoint",
"description": "Add node-1 as worker",
"children": []
}
]
}
],
"total_commits": 47
}

These cover the whole store, every namespace included. Over HTTP, an API key bound to a namespace can’t use them.

Project-history metrics from the distilled history tables: commit velocity, intent mix, authorship, and the milestone timeline.

Parameters:

NameTypeRequiredDefaultDescription
bystringno"day"Roll velocity up by "day" or "week"
milestonesnumberno50Max milestones on the timeline
refreshbooleannotrueDistil new commits before reporting; false reads the tables as they are
storebooleannofalseAttach the physical store shape (objects, commits, bytes)
namespacestringnoRestrict every view to one namespace; omit for the whole store

Example output:

{
"authorship": [{ "agent": "agent/planner", "commits": 3 }],
"intent_mix": [{ "category": "Refine", "commits": 3 }],
"milestones": [
{
"agent": "system",
"commit": "sg_7b65729bf3af",
"day": "2026-10-07",
"description": "Initialize empty state",
"kind": "checkpoint",
"namespace": "unattributed",
"timestamp": "2026-10-07T20:47:23.890165+00:00"
}
],
"namespaces": ["unattributed"],
"totals": { "agents": 2, "commits": 4, "cursor": 4, "periods": 1 },
"velocity": { "by": "day", "series": [{ "commits": 4, "period": "2026-10-07" }] }
}

Report what a garbage collection would reclaim, without changing anything. It won’t call a sweep safe while any commit is undistilled, because the history tables wouldn’t yet hold what the sweep removes.

Parameters: none.

Example output:

{
"dry_run": true,
"mutates": false,
"safe": true,
"safety": { "reason": "all commits distilled — reclaimable objects' signal is captured in the history tables", "undistilled_commits": 0 },
"objects": { "live": 4, "reclaimable": 6, "reclaimable_pct": 60.0, "total": 10 },
"commits": { "total": 4 },
"bytes": { "current_total": 217088, "estimated_reclaimable": 2457, "estimated_post_vacuum": 214631, "dbstat_available": true },
"roots_walked": 1
}

Sweep under a retention policy. With mutate: true it deletes object versions no longer reachable from the kept commits. Branch tips, sealed epochs, milestones and the kept history are always preserved. It refuses to delete while any commit is undistilled. Without mutate, it previews.

Parameters:

NameTypeRequiredDefaultDescription
keep_recentnumberno100Keep the N most recent commits’ state in full
checkpoint_everynumberno100Among older commits, keep every Kth as a checkpoint (0 disables)
keep_milestonesbooleannotrueKeep milestone snapshots
mutatebooleannofalseMust be true to delete; otherwise a preview
vacuumbooleannofalseCompact the store after a deleting sweep

Example output (preview):

{
"dry_run": true,
"mutated": false,
"safe": true,
"undistilled_commits": 0,
"keep_roots": 4,
"policy": { "keep_recent": 100, "checkpoint_every": 100, "keep_milestones": true },
"would_reclaim": { "live_objects": 9, "reclaimable_objects": 1, "reclaimable_pct": 10.0, "roots_walked": 4, "total_objects": 10 }
}

Compact the store, returning freed space to the OS. Run it after a sweep.

Parameters: none.

Example output:

{ "bytes_before": 217088, "bytes_after": 201216, "bytes_reclaimed": 15872 }

Plans and tasks are stored in AgentStateGraph as structured state. Each plan is a collection of tasks with a strict state machine (pending → in_progress → done). Tasks can be assigned to agents, have blockers, carry Proof of completion, and are filterable by IntentCategory::Plan in log and blame queries.

Create a new plan.

Parameters:

NameTypeRequiredDefaultDescription
refstringno"main"Branch
namestringyesPlan name (e.g., "deploy-v2")
descriptionstringnoPlan description

Example input:

{
"name": "deploy-v2",
"description": "Rolling upgrade of all cluster nodes to v2.0"
}

Example output:

Plan 'deploy-v2' created

List all plans, optionally filtered by status.

Parameters:

NameTypeRequiredDefaultDescription
refstringno"main"Branch
statusstringnoFilter by status: Active, Completed, or Archived

Example input:

{ "status": "Active" }

Example output:

[
{
"id": "deploy-v2",
"title": "Deploy version 2.0",
"task_count": 3,
"completed": 1,
"created": "2026-04-10T09:00:00Z"
}
]

Get a plan with all its tasks.

Parameters:

NameTypeRequiredDefaultDescription
refstringno"main"Branch
namestringyesPlan name

Example input:

{ "name": "deploy-v2" }

Example output:

{
"id": "deploy-v2",
"title": "Deploy version 2.0",
"tasks": [
{ "id": "t-001", "title": "Drain node-1", "status": "done", "assigned_to": "agent/ops" },
{ "id": "t-002", "title": "Upgrade node-1", "status": "in_progress", "assigned_to": "agent/ops" },
{ "id": "t-003", "title": "Verify node-1", "status": "pending", "assigned_to": null }
]
}

Add a task to a plan. The task ID (t-NNN) is auto-assigned and returned.

Parameters:

NameTypeRequiredDefaultDescription
refstringno"main"Branch
planstringyesPlan name to add the task to
titlestringyesTask title
prioritystringno"Medium"Low, Medium, High, or Critical
parent_idstringnoParent task ID for subtasks (e.g., "t-001")
blocked_bystring[]noTask IDs that must complete first
assigned_tostringnoAgent to assign the task to

Example input:

{
"plan": "deploy-v2",
"title": "Update DNS records",
"priority": "High",
"blocked_by": ["t-003"]
}

Example output:

Task 't-004' added to plan 'deploy-v2'

List all tasks in a plan.

Parameters:

NameTypeRequiredDefaultDescription
refstringno"main"Branch
planstringyesPlan name

Example input:

{ "plan": "deploy-v2" }

Example output:

[
{ "id": "t-003", "title": "Verify node-1", "status": "pending", "priority": "medium" },
{ "id": "t-004", "title": "Update DNS records", "status": "pending", "priority": "high", "blocked_by": ["t-003"] }
]

Transition a task from pending to in_progress.

Parameters:

NameTypeRequiredDefaultDescription
refstringno"main"Branch
planstringyesPlan name
task_idstringyesTask identifier (e.g., "t-002")

Example input:

{ "plan": "deploy-v2", "task_id": "t-002" }

Example output:

Task 't-002' started

Transition a task from in_progress to done. A typed proof is required.

Parameters:

NameTypeRequiredDefaultDescription
refstringno"main"Branch
planstringyesPlan name
task_idstringyesTask identifier
proof_kindstringyesCommit, File, Test, or Text
proof_valuestringyesCommit hash, file path, test name, or text
proof_notestringnoOptional note

Example input:

{
"plan": "deploy-v2",
"task_id": "t-002",
"proof_kind": "Commit",
"proof_value": "sg_f5b2c39e...",
"proof_note": "Node-1 upgraded and passing health checks"
}

Example output:

Task 't-002' completed

Abandon a task with a reason. abandoned is terminal.

Parameters:

NameTypeRequiredDefaultDescription
refstringno"main"Branch
planstringyesPlan name
task_idstringyesTask identifier
reasonstringyesWhy the task is being abandoned

Example input:

{ "plan": "deploy-v2", "task_id": "t-002", "reason": "Node-1 failed pre-flight checks" }

Example output:

Task 't-002' abandoned

Assign a task to an agent.

Parameters:

NameTypeRequiredDefaultDescription
refstringno"main"Branch
planstringyesPlan name
task_idstringyesTask identifier
agentstringyesAgent to assign the task to

Example input:

{ "plan": "deploy-v2", "task_id": "t-003", "agent": "agent/verifier" }

Example output:

Task 't-003' assigned to 'agent/verifier'

Get the next highest-priority unblocked task (optionally for a specific agent).

Parameters:

NameTypeRequiredDefaultDescription
refstringno"main"Branch
planstringyesPlan name
agentstringnoPrefer tasks assigned to this agent

Example input:

{ "plan": "deploy-v2", "agent": "agent/ops" }

Example output:

{ "id": "t-003", "title": "Verify node-1", "priority": "medium", "assigned_to": null }

Policies express authorization rules and cost-of-change thresholds. A policy is proposed, ratified, optionally signed (Ed25519), and then active. Changes can be evaluated against the active policy before they are committed, optionally through a pluggable Cedar / Rego / WASM evaluator. Evaluation produces a Decision — Allow, Deny, RequireApproval (with a fallback action), or NoPolicyMatch — with a fail-safe deny applied by the server when nothing matches (--policy-fail-safe allow to change it). Precedence is deny > require_approval > allow. See the Policy guide for the full model.

Propose a new policy. The policy is a full Policy JSON document (it carries its own path). Proposed policies are unratified and ignored by the evaluator until ratified.

Parameters:

NameTypeRequiredDefaultDescription
refstringno"main"Branch
policyobjectyesFull Policy JSON (path, description, rules, …)

Example input:

{
"policy": {
"path": "/cluster",
"description": "High-confidence gate for cluster writes",
"rules": [
{ "match": { "path_prefix": "/cluster/" }, "min_confidence": 0.8, "effect": "require_approval" }
]
}
}

Example output:

Policy proposed at /cluster (version 1, unratified)

Ratify an unratified policy at path, making it active.

Parameters:

NameTypeRequiredDefaultDescription
refstringno"main"Branch
pathstringyesPolicy path to ratify
ratifierstringyesAgent or principal ratifying
reasoningstringyesWhy this policy is being ratified

Example input:

{ "path": "/cluster", "ratifier": "agent/lead", "reasoning": "Reviewed and approved" }

Example output:

Policy /cluster ratified

Replace the active policy at old_path with a new version. Returns the new path@version handle.

Parameters:

NameTypeRequiredDefaultDescription
refstringno"main"Branch
old_pathstringyesPath of the policy being superseded
new_policyobjectyesFull new Policy JSON

Example input:

{
"old_path": "/cluster",
"new_policy": {
"path": "/cluster",
"description": "Raise confidence threshold to 0.9",
"rules": [ { "match": { "path_prefix": "/cluster/" }, "min_confidence": 0.9, "effect": "require_approval" } ]
}
}

Example output:

Policy /cluster superseded → /cluster@2

List policies, optionally filtered by path prefix, status, and tenant.

Parameters:

NameTypeRequiredDefaultDescription
refstringno"main"Branch
prefixstringnoPath prefix filter
statusstringno"active""active", "proposed", or "all"
tenant_filterstringnoRestrict to a tenant (globals always apply)

Example output:

[
{ "path": "/cluster", "version": 2, "status": "active", "description": "Cluster write gate v2" }
]

Show a policy at a path (active version, or a pinned version).

Parameters:

NameTypeRequiredDefaultDescription
refstringno"main"Branch
pathstringyesPolicy path
versionnumbernoPin a specific version (default: active)

Example output:

{
"path": "/cluster",
"version": 2,
"status": "active",
"description": "Cluster write gate v2",
"ratified_by": "agent/lead",
"rules": [ { "match": { "path_prefix": "/cluster/" }, "min_confidence": 0.8, "effect": "require_approval" } ]
}

Walk a policy’s supersedes chain at a path.

Parameters:

NameTypeRequiredDefaultDescription
refstringno"main"Branch
pathstringyesPolicy path

Example output:

[
{ "path": "/cluster", "version": 1, "status": "superseded", "supersedes": null },
{ "path": "/cluster", "version": 2, "status": "active", "supersedes": "/cluster@1" }
]

Evaluate an authorization request against active policies. The situation is a flat string map of facts.

Parameters:

NameTypeRequiredDefaultDescription
refstringno"main"Branch
situationobjectyesFlat { string: string } map of situation facts
actionstringyesThe action being requested
agent_idstringyesAgent requesting the evaluation
tenant_filterstringnoRestrict to a tenant (globals always apply)

Example input:

{
"situation": { "path": "/cluster/replicas", "confidence": "0.65" },
"action": "write",
"agent_id": "agent/scaler"
}

Example output:

Decision: RequireApproval
Reason: Confidence 0.65 is below required threshold 0.8 for /cluster/* writes

Evaluate a full ChangeProposal against active policies before committing. Returns a Decision with a fallback action.

Parameters:

NameTypeRequiredDefaultDescription
refstringno"main"Branch the change would be applied to
proposalobjectyesFull ChangeProposal JSON (action, agent_id, intent, preferred_option, alternatives, tokens, attached_fields)
tenant_filterstringnoRestrict to a tenant (globals always apply)

Example input:

{
"proposal": {
"action": "write",
"agent_id": "agent/scaler",
"preferred_option": { "path": "/cluster/replicas", "value": 5 },
"confidence": 0.65
}
}

Example output:

Decision: RequireApproval (fallback: KeepCurrentState)
Reason: Confidence 0.65 is below required threshold 0.8 for /cluster/* writes

Pre-flight check: list the active policies whose triggers match the given tokens. Use it to discover which policies would fire before proposing a change.

Parameters:

NameTypeRequiredDefaultDescription
refstringno"main"Branch
tokensstring[]yesTrigger tokens to match against

Example input:

{ "tokens": ["destructive", "/cluster/"] }

Example output:

[ { "path": "/cluster", "version": 2, "matched": ["destructive"] } ]

Sign the active policy at a path with the server’s registered PolicySigner. The signing key is configured on the server, not passed in the call.

Parameters:

NameTypeRequiredDefaultDescription
refstringno"main"Branch
pathstringyesPolicy path to sign
signer_key_idstringnoHint for multi-key signers; Ed25519Signer ignores it

Example input:

{ "path": "/cluster" }

Example output:

{ "algorithm": "ed25519", "signer_key_id": "lead-key-1", "signature_hex": "3f8a2b..." }

Verify the signature on the active policy at a path, using the verifying key looked up by signer_key_id in the server’s key registry.

Parameters:

NameTypeRequiredDefaultDescription
refstringno"main"Branch
pathstringyesPolicy path to verify

Example input:

{ "path": "/cluster" }

Example output:

{ "valid": true, "algorithm": "ed25519", "signer_key_id": "lead-key-1" }

Taint marks paths as sensitive, suspicious, or under watch. Quarantined paths require policy evaluation before changes are allowed. Watch marks trigger audit notifications. All taint operations are audit-committed with IntentCategory::Taint (or the corresponding variant) so they appear in log and blame.

Apply a named taint to a path. The effect controls what the pre-commit hook does on subsequent writes.

Parameters:

NameTypeRequiredDefaultDescription
refstringno"main"Branch
pathstringyesPath to taint
namestringyesTaint name (used to resolve it later)
effectstringyeswarn, block, review, or isolate
reasonstringyesWhy this path is being tainted
severitystringno"medium"low, medium, high, or critical
expiresstringnoRFC3339 expiry; null = permanent
propagateboolnotrueCascade to descendant paths
agent_idstringyesAgent applying the taint

Example input:

{
"path": "/cluster/credentials",
"name": "cred-exposure-2026-05",
"effect": "block",
"severity": "high",
"reason": "Potential credential exposure detected",
"agent_id": "agent/security"
}

Example output:

Taint 'cred-exposure-2026-05' applied: /cluster/credentials (block/high)

Resolve a named taint on a path. The taint is resolved (not deleted) to preserve the audit trail.

Parameters:

NameTypeRequiredDefaultDescription
refstringno"main"Branch
pathstringyesPath to untaint
namestringyesName of the taint to resolve
reasonstringyesWhy the taint is being lifted
proofstringnoEvidence the issue is resolved
agent_idstringyesAgent resolving the taint

Example input:

{
"path": "/cluster/credentials",
"name": "cred-exposure-2026-05",
"reason": "Credentials rotated and verified clean",
"agent_id": "agent/security"
}

Example output:

Taint 'cred-exposure-2026-05' removed: /cluster/credentials

Quarantine a path, restricting writes to an explicit list of authorized agents.

Parameters:

NameTypeRequiredDefaultDescription
refstringno"main"Branch
pathstringyesPath to quarantine
namestringyesQuarantine name
reasonstringyesWhy
authorized_agentsstring[]yesAgents permitted to write under the path
severitystringno"high"low, medium, high, or critical
expiresstringnoRFC3339 expiry; null = permanent
propagateboolnotrueCascade to descendant paths
agent_idstringyesAgent applying the quarantine

Example input:

{
"path": "/cluster/node-3",
"name": "node-3-compromise",
"severity": "critical",
"reason": "Node-3 compromised",
"authorized_agents": ["agent/security"],
"agent_id": "agent/security"
}

Example output:

Quarantine 'node-3-compromise' applied: /cluster/node-3 (critical)

Lift a named quarantine from a path (resolved, not deleted).

Parameters:

NameTypeRequiredDefaultDescription
refstringno"main"Branch
pathstringyesPath to unquarantine
namestringyesName of the quarantine to lift
reasonstringyesWhy quarantine is being lifted
proofstringnoEvidence the path is safe
agent_idstringyesAgent lifting the quarantine

Example input:

{
"path": "/cluster/node-3",
"name": "node-3-compromise",
"reason": "Node-3 reimaged and verified",
"agent_id": "agent/security"
}

Example output:

Quarantine 'node-3-compromise' lifted: /cluster/node-3

Apply an advisory watch to a path. With a metric/threshold/direction it auto-escalates to a warn taint when a write crosses the threshold.

Parameters:

NameTypeRequiredDefaultDescription
refstringno"main"Branch
pathstringyesPath to watch
namestringyesWatch name
reasonstringyesWhy
metricstringnoNumeric field to monitor for escalation
thresholdnumbernoEscalation threshold
directionstringno"above"above or below
check_interval_secsnumbernoRe-check cadence
expiresstringnoRFC3339 expiry
severitystringnoSeverity if escalated
propagateboolnotrueCascade to descendant paths
agent_idstringyesAgent applying the watch

Example input:

{
"path": "/cluster/network",
"name": "topology-watch",
"reason": "Monitoring for unexpected topology changes",
"agent_id": "agent/monitor"
}

Example output:

Watch 'topology-watch' applied: /cluster/network

Remove a named watch from a path.

Parameters:

NameTypeRequiredDefaultDescription
refstringno"main"Branch
pathstringyesPath to unwatch
namestringyesName of the watch to remove
reasonstringnoWhy
agent_idstringyesAgent removing the watch

Example input:

{ "path": "/cluster/network", "name": "topology-watch", "agent_id": "agent/monitor" }

Example output:

Watch 'topology-watch' removed: /cluster/network

List taints, quarantines, and watches, with optional filters.

Parameters:

NameTypeRequiredDefaultDescription
pathstringnoFilter to a path
kindstringnotaint, quarantine, or watch (default: all)
effectstringnowarn, block, review, or isolate (client-side filter)
include_expiredboolnofalseInclude expired marks

Example output:

[
{
"path": "/cluster/credentials",
"name": "cred-exposure-2026-05",
"kind": "quarantine",
"severity": "high",
"reason": "Potential credential exposure detected",
"agent_id": "agent/security",
"created_at": "2026-04-10T14:00:00Z"
}
]

Check the full taint status for a path, including marks inherited from ancestor paths. Optionally evaluate write access for a specific agent and confidence.

Parameters:

NameTypeRequiredDefaultDescription
pathstringyesPath to check
agent_idstringnoAgent to evaluate access for
confidencenumbernoCommit confidence (for the review effect gate)

Example input:

{ "path": "/cluster/credentials", "agent_id": "agent/ops", "confidence": 0.95 }

Example output:

{
"tainted": true,
"kind": "quarantine",
"effect": "block",
"severity": "high",
"can_write": false,
"reason": "Potential credential exposure detected"
}

agentstategraph_policy_evaluate_change_with_taints

Section titled “agentstategraph_policy_evaluate_change_with_taints”

Evaluate a change proposal against active policies and the taints on each affected path in one call. Returns { decision, taint_status, can_proceed }, where can_proceed is true only when the decision is not deny and every path is writable.

Parameters:

NameTypeRequiredDefaultDescription
refstringno"main"Branch
proposalobjectyesFull ChangeProposal JSON
affected_pathsstring[]noPaths the change would touch (each is taint-checked)
agent_idstringnoAgent for the taint-check pass (falls back to proposal.agent_id)
confidencenumberno1.0Confidence for the review-effect gate
tenant_filterstringnoRestrict policies to a tenant

Example input:

{
"proposal": {
"action": "write",
"agent_id": "agent/ops",
"preferred_option": { "path": "/cluster/credentials", "value": { "token": "new-token" } }
},
"affected_paths": ["/cluster/credentials"],
"confidence": 0.95
}

Example output:

{ "decision": "Allow", "taint_status": "Quarantine", "can_proceed": false }

Pull-based reminders let agents and users schedule future work with priority, repeating schedules, soft object references, and an optional autonomous execution flag. Agents call remind_me at checkpoints (session start, task transitions, branch switches) to receive all currently due items.

Schedule string format: "once" | "interval:<seconds>" | "daily:HH:MM" | "weekly:Weekday:HH:MM" (e.g. "weekly:Monday:09:00").

Priority values: "critical" | "high" | "medium" (default) | "low" | "minimal".

Ref kind values: "branch" | "memory" | "plan" | "task" | "state_path" | "external:<scheme>".


Create a new reminder.

Parameters:

NameTypeRequiredDefaultDescription
titlestringyesShort human-readable title
instructionsstringyesWhat to do when due
due_atstringyesISO 8601 due timestamp
schedulestringno"once"Schedule string (see above)
prioritystringno"medium"Priority (see above)
autonomousboolnofalseExecute without asking permission
created_bystringnoAgent or user id creating this
commandsstring[]noCLI commands to run at execution time
tagsstring[]noArbitrary tags for filtering
refsobject[]noSoft refs: [{"kind":"branch","id":"main","label":"main branch"}]

Example input:

{
"title": "Stop local web server",
"instructions": "The dev server started for PR review may still be running. Check and terminate it.",
"due_at": "2026-05-03T09:00:00Z",
"priority": "high",
"autonomous": false,
"created_by": "agent/dev",
"tags": ["cleanup", "server"]
}

Example output:

{ "id": "rem-0193a4f2-...", "status": "Pending" }

List reminders with optional filtering.

Parameters:

NameTypeRequiredDefaultDescription
statusstringnoFilter by status: Pending, Due, AwaitingPermission, InProgress, Completed, Snoozed, Cancelled
priority_at_moststringnoOnly return items at this priority or higher (e.g. "high" returns Critical + High)
created_bystringnoFilter by creator id
due_beforestringnoOnly items due before this ISO 8601 timestamp
ref_idstringnoOnly items that reference this object id
tagsstring[]noItems that have ALL of these tags

Example input:

{ "status": "Due", "priority_at_most": "high" }

The core pull-based query. Lazily promotes past-due Pending items and expired Snoozed items to Due, then returns all Due and AwaitingPermission items ordered by priority then due date. Call this at checkpoints.

Parameters:

NameTypeRequiredDefaultDescription
created_bystringnoScope to a specific agent or user

Example output:

[
{
"id": "rem-0193a4f2-...",
"title": "Stop local web server",
"status": "Due",
"priority": "High",
"due_at": "2026-05-03T09:00:00Z",
"autonomous": false
}
]

Defer a Due or Pending reminder until a later time.

Parameters:

NameTypeRequiredDefaultDescription
idstringyesReminder id
untilstringyesISO 8601 timestamp to snooze until

Approve a reminder that is in AwaitingPermission status (created with autonomous: false). Transitions it to Due so the agent can proceed.

Parameters:

NameTypeRequiredDefaultDescription
idstringyesReminder id
approved_bystringyesUser or agent id granting approval

Cancel a reminder (terminal state; cannot be undone).

Parameters:

NameTypeRequiredDefaultDescription
idstringyesReminder id
reasonstringnoWhy it is being cancelled

Record the result of executing a reminder. If the reminder has a repeating schedule and the result is success, the next due time is computed and the reminder resets to Pending (or AwaitingPermission for non-autonomous). A once reminder transitions to Completed on success.

Parameters:

NameTypeRequiredDefaultDescription
idstringyesReminder id
agent_idstringyesAgent that executed the reminder
resultstringyessuccess, failed, or cancelled
started_atstringyesISO 8601 execution start time
completed_atstringyesISO 8601 execution end time
approved_bystringnoWho approved execution (for non-autonomous)
notesstringnoFree-form execution notes
task_idstringnoId of the task created for this execution

Example input:

{
"id": "rem-0193a4f2-...",
"agent_id": "agent/dev",
"result": "success",
"started_at": "2026-05-03T09:01:00Z",
"completed_at": "2026-05-03T09:01:05Z",
"notes": "Server process was not running; nothing to terminate."
}