guard_contract
List, add, or remove project contract constraints so agents can recall durable rules and track session rules. Use list to review, add owner-defined rules, and remove only agent-added ones.
Instructions
List, add, or remove a project contract constraint.
Use list before acting on rules you might have forgotten, add when the
owner states a durable constraint this session should keep, and remove
only for a constraint this agent added. action is a required string:
list, add, or remove. text is an optional string, required for
add. id is an optional string, required for remove. list returns
the merged contract (project plus personal layer) and a Nudge. add
returns the new id and the rendered contract, or a duplicate notice.
remove returns the rendered contract, or a refusal. Side effects: list
creates .agent-guard/ and, when contract.json is missing, writes the
twelve seed constraints. add and remove rewrite the project
contract.json only. This tool never writes the personal layer
(--global / ~/.config/protect-context). Removing a seed constraint is
refused; the owner removes those with the CLI or /guard-contract.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"action": "<action>"
},
"name": "guard_contract"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | No | Constraint id for action "remove", such as 13-write-tests-first. String. Required for remove; ignored otherwise. Seed ids (source "seed") are refused. | |
| text | No | Constraint text for action "add". String. Required for add; ignored for list and remove. A blank or missing value is an error. The new row is stored with source "agent". | |
| action | Yes | What to do with the project contract. Required string: "list", "add", or "remove". Any other value returns an error line. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |