Skip to main content
“Rule” names two different things in Pinework. For why rules work this way, see Rules and instructions. pinework rules instructions and pinework agent rule edit instruction rules. pinework rules list|add|update|delete edit the permission floor.

States

Rules have no lifecycle. An agent’s edit to AGENT.md, an agent rule or a project rule can need a person’s approval. That edit becomes an instruction proposal, and the proposal has states. Who needs approval for which edit: A request that needs approval returns HTTP 202 with object: "platform_change", an approvalId and status: "pending". The agent must be in a live run to raise it. Two values are flags, not states. A permission rule’s enabled parks it off the floor without deleting it. A workspace rule’s per-agent enabled is null when the agent inherits it, false when turned off, and true when turned back on.

Fields

Workspace instruction rule

string
required
UUID of the rule.
string
required
Workspace the rule belongs to.
string
required
Unique name in the workspace. You manage the rule by it.
string
required
The text agents read.
string
required
Origin scope tier.
string
required
Origin. A rule written in Pinework has native.
string
required
SHA-256 of the normalized content.
integer
Approximate token cost per run. Null when not counted yet.
string
Creation time.
string
Last change time.
A project rule has the same fields minus scope, provenance and contentHash, plus projectId.

Agent rule

string
required
Rule name. Lowercase letters, digits and hyphens, starting with a letter or digit.
string
required
The text this agent reads.
integer
Approximate token cost per run. Null when not counted yet.

Instruction proposal

string
required
Always instruction_proposal_target.
string
required
The apr_… approval that decides the edit.
string
The iprop_… id of an older stored proposal. Null for edits raised as an approval request.
string
required
agent_md, agent_rule or project_rule.
string
required
proposed, applied or rejected.
string
required
Readable name of what the edit changes.
string
Rule name. Null for an AGENT.md edit.
string
New text. Null when the edit deletes a rule.
string
Text the edit replaces. Null when nothing exists yet.
string
Agent that asked for the edit.
string
required
When the edit was proposed.

Permission rule

string
required
rule_ plus 10 hex characters. It changes when the content changes.
string
required
deny, ask or allow.
string
required
One readable line for the rule.
boolean
required
false when the rule is parked off the floor.
You write a permission rule in one of two shapes:
string
required
builtin for a built-in tool, mcp for an MCP tool.
string
required
For builtin: read, edit, write, bash, glob, grep, agent, web_fetch, tool_search, multi_edit or notebook_edit. For mcp: a tool name or *.
string
MCP server name. Required when kind is mcp.
object
Narrows a builtin rule. Leave it out to match every call.
string
required
deny, ask or allow.
When rules target the same tool and argument, deny beats ask and ask beats allow.

CLI

The agent rule verbs default to the calling agent. --tool takes runtime names such as Bash or Read, or mcp__server__tool.

API

Workspace routes also answer under /api/v1/workspaces/{workspaceId} in place of /api/v1/companies/{workspaceId}, except the permission routes.

Errors

Two errors carry only an error string. A duplicate workspace rule name returns 409 “A rule with this name already exists”. A bad agent rule name returns 400 “Invalid rule name”. Shared codes are in API errors.

Limits

  • An instruction rule name holds up to 255 characters.
  • rules history returns up to 100 entries per page.

Rules and instructions

How rules at each scope reach a run.

Agent

AGENT.md, config and history.

Approval

How a proposed edit gets decided.

Import

Bring CLAUDE.md and AGENTS.md in as workspace rules.