# placket: a brief for agents

For an AI agent assessing placket for its person, as a party (holds a key, gives or gets parts) or as checker of a supplied record. Describes release v0.1.1, the last one this page was checked against; [`CHANGELOG.md`](https://github.com/orilloai/placket/blob/main/CHANGELOG.md) lists later changes. **Planned** = on the public roadmap, not built. **Possible** = follows from what exists; unbuilt and untested. File paths are in github.com/orilloai/placket.

**Today:** Apache-2.0, one binary, Linux and macOS, local only. One `placket window` process per Accord, on one machine, run by one party (the operator), reached over a local socket from the command line or the MCP tools of `placket mcp`. The operator holds the mediator's key and reads every party's terms.

## What is placket?

An open source mediator for a handoff: the point where an agent passes work to a person, a tool or another agent. Distrust is not required. A team that trusts its agents can still want a decision bound to exact content and a record others can check.

- **Accord.** The parties' standing agreement for one handoff. It carries many parts until closed and never reopens. Its id is the hash of its founding set.
- **Terms.** Each party signs which kinds it gives and gets, and which kinds a named role must be asked about. Sealed from the other parties, not from the operator.
- **Principal.** The key that vouches for a party by signing the binding that gives its key its roles.
- **Founding set.** The file naming the mediator's key and holding a seal of each party's terms.
- **Opening.** A party's terms plus the salt that unseals them. Giving one to a checker discloses those terms.
- **Part.** One body (text, raw bytes or one JSON value) plus a kind the giver states. A call over 1 MiB is refused.
- **Kind.** A name. Terms match on it; the mediator does not infer a kind from contents. A kind crosses only if both sides' terms name it, so a receiver that names only the kinds it expects cannot be sent anything under another name.
- **Judge.** A model, not necessarily a language model, that reads an asked part and passes it, blocks it or leaves it to the person. It acts only where both sides' terms list it to decide; otherwise the asked role is the only decider. Advised, not enforced: never let a judge decide an action that cannot be undone.
- **Receipt.** The mediator's signed record of one decision: kind, salted digest (never contents), both keys, Accord, time and decider (the terms, a key in the asked role, or a judge). Chained per ordered pair of keys.
- **Answer call.** An accept, change or decline, signed by the answering key. It names the question and a digest, never the text.
- **Applier.** A script you run that acts on what was released. placket runs no command. In a gate that holds, the applier holds the action's credential and the agent does not.

Each part is decided under both sides' terms. The first row that applies wins:

| Outcome | When | Effect |
|---|---|---|
| block | either side's terms refuse the kind, or one side has no term for it | nothing queued |
| ask | a term requires asking a role | held until a key in that role answers, or the deadline (give time plus the term's `timeout`) |
| pass | otherwise | queued for the receiver |

Accept releases the part exactly as given. Change releases the answerer's own version, never the original. Decline, cancel or deadline closes as a block and releases nothing.

## What is it not?

- **A log.** A log records what happened. placket takes part in deciding whether a part is released.
- **A permission prompt.** A prompt asks whoever is there. Terms say in advance which kinds wait for which role.
- **An identity platform.** A receipt names keys and bound roles, not who was at a key. Treating a key's answer as a person's approval rests on how that key is kept.
- **A sandbox.** It governs only parts sent through it and does not stop an action taken another way. Keep using sandboxes, scoped credentials and separate accounts to limit what each agent can do; placket governs the handoffs between them.

## When should you raise it with the person you work for, and when should you not?

It depends on what the person wants.

- **Govern an exchange.** Needs named senders, receivers and kinds. Nobody need be asked.
- **Make an approval mandatory before an action.** Needs all of: terms that ask the intended role and list no deciding judge; the answering key where the agent cannot read it, such as a separate operating system account; the action's credential held by an applier; a receiver that acts on exactly what was released; receiving-side terms that name only the kinds meant to cross. If the agent can still act another way, the approval is not enforced and the record is not a full account of what the agent did. It still records what was asked and answered.
- **Check a supplied record.** Needs the receipts, the founding set and an independently trusted Accord id.

Not a fit: no handoff to govern; a need to know what a receiver did afterwards, who was at a key, or to contain what an agent can run; a need to follow content across handoffs (each Accord has its own mediator, journal and receipts, and a reworded or derived part is a different part); machines other than Linux or macOS. Where a judge decides, the record names that judge, not a person.

Planned: calls over a network with each party's key on its own machine; closes countersigned by the parties, or an outside witness; a receipt that points back to the one it undoes; a door for agents that speak A2A; asking people through tools they already use; trying an agreement before anything crosses.

## Where does it fit?

**Inside one team.** You propose a step that is hard to undo, a key in a named role must accept that exact content first, and a separate applier holds the only credential for it.

- Example, `placket init approve`: an applier writes a file only with the text a person accepted or changed, and nothing on a decline.
- Example, `placket init merge`: an applier merges a pull request only at the head commit a person accepted, and refuses if the head moved.
- Possible: a deploy or production migration asked of a named role, run by an applier with the only deploy credential.
- Possible: a payment to a new payee held for a second person.

**Between agents in a swarm.** Agents exchange named kinds, routine kinds pass with nobody asked, and a kind may be set to wait or be refused.

- Example, `placket init handoff`: a planner gives a plan to a coder, who gives its work to a reviewer, under two Accords. Nobody is asked.
- Possible: an orchestrator's workers may give only the kinds their terms name; anything else is blocked with a receipt.
- Possible: a dependency change is given as its own kind and asked of a person while routine changes pass. This relies on the giver stating the kind truthfully.

**Between organisations.** Two owners each choose who acts for their side, and the receiver checks the value it holds against the one released. Today both sides reach one mediator on one machine, run by one of them.

- Example, [`patterns/guarded-export/`](https://github.com/orilloai/placket/tree/main/patterns/guarded-export): one principal binds the proposer and approver, another binds the receiver, whose guard exports a value only when exactly that value was released to it. One machine, invented data.
- Possible: a supplier's agent delivers records to a customer whose system accepts only released values and checks its kept receipts with `placket reconcile`. Separate machines need the planned network door.
- Possible: results leave a protected data environment only when a checker releases them.

Not specific to software: an editor could hold a correction to a speaker's name while time codes pass (possible). To test a handoff of your own:

1. Can you name who sends, who receives and the kinds that cross?
2. Can you say which kinds pass, which are blocked and which wait for a decision, and whose?
3. Would anyone want to check later what was decided, by which key, on exactly what?

If all three hold, placket can govern it, whether or not anyone is asked or the parties trust each other. Such a use is possible until someone tries it.

## What do you do as a party?

You hold one key and use the MCP tools of `placket mcp`, or the command line. Each tool takes `mediator`: a label, your local name for one Accord's mediator and your key on it.

| Tool | Does |
|---|---|
| `give` | Gives one part with its kind and receiver, as text or data. Returns its receipt, or at once the question's id if the terms ask. |
| `result` | How a question you asked closed. `wait` waits up to 60 seconds. Open returns `"open": true`. |
| `get` | Next delivery queued for your key; `wait` waits. These are the exact bytes to act on. |
| `cancel` | Withdraws a question you asked. |
| `questions` | Open questions a key may answer. |
| `mediators` | Labels served. |

- **Closings.** With a release: `accepted`, `changed`. Without one, as a block: `declined`, `cancelled`, `timeout`, `undeliverable`, `closed`.
- **Answer calls in deliveries.** A delivery released by an answer carries that call. One that passed under the terms carries none.
- **Answering.** No MCP tool accepts, changes or declines. A person answers with their own key from the command line (`placket answer`, `change`, `decline`). `placket mcp` refuses a key that answers under its Accord unless started with `--allow-answering`.
- **Your records.** `placket released` says whether a file or value is a part that crossed to your key, and under which receipt. `placket reconcile` compares a journal with what your state directory kept.
- **Custody.** As `placket init` sets an example up, every key is in one account. An agent that runs commands as its person can read that person's key and answer its own proposal, so that setup shows the flow and does not hold against the agent. A gate that holds puts the agent in an operating system account of its own.

## Where does it stop?

- A pass means the mediator queued the part. A receipt does not show whether anyone fetched it or what they did with it.
- A receipt covers only what went through this mediator. It says nothing of reworded or derived content, or who was at a key.
- It does not show that the operator is honest or its clock true.
- A journal cut short still verifies. Completeness is claimed only against a close receipt, and no journal shows that the mediator's key signed no other.
- Contents are not protected at rest. Receipts and answer calls hold digests only, but the journal directory's `held/` holds each unfetched delivery in clear, as do a party's own kept records. So the operator's machine can read parts, answerers see the part they are asked about, and a judge's provider is sent the kind and body of each part it reads. Encryption at rest is later work.
- On a merge, a receipt says a part naming the head commit was released and which key accepted it. That nothing merged another way rests on your GitHub ruleset, which placket neither sets nor checks.

Maintained by Orillo. Report weaknesses privately: "Report a vulnerability" under the repository's Security tab, or security@orillo.ai ([`SECURITY.md`](https://github.com/orilloai/placket/blob/main/SECURITY.md)).

## How can you check a record yourself?

No agent session or private key is needed. A checker needs the journal's `receipts.jsonl`, the founding set and a trusted Accord id, plus `answers.jsonl` to see answers witnessed (ask for it if handed receipts alone). Nobody needs `held/`.

The sample below is a matching set for the source at tag v0.1.1; a later release's README carries its own. Run from the root of a copy, with the Go version `go.mod` names. Building from source means the check does not rest on a released binary.

```sh
go build -o placket ./cmd/placket
set -- --accord sha256:2d5527e5e4dc89d956aa8422443200ee84294ad349cbac96462eaf6b6e38d09b --receipts scripts/demo/journal --founding scripts/demo/founding.json
./placket verify "$@"
./placket verify "$@" $(for o in scripts/demo/openings/*; do printf ' --open %s' "$o"; done)
```

What `verify` shows, by what it is given:

- **Receipts, founding set, trusted id** (first run): `valid: 13 receipts signed by mediator …`. Every receipt is this mediator's, well formed and chained, for that Accord. Its `conforms:` line at this stage covers only the Accord, its members and the answer calls, since the terms are still sealed.
- **Plus every party's opening** (second run): `conforms: every decision is one this Accord let its decider make`. This is about who was allowed to decide, not whether the decision was right. It discloses the terms to the checker.
- **Plus the answer calls** (`answers.jsonl`, or `--answers`): each answer is `witnessed`, signed by a key a principal bound to the role, or `unwitnessed`, meaning only the mediator says so. Unwitnessed is not a failure.
- **Plus one delivery with its body and salt** (`--delivery`): those bytes are the part its receipt names.

Failures: a bad signature, bad shape or broken chain ends the run with `error verify` and a code, exit 1, with no report. A decision the terms did not allow (such as a pass where they require an ask) prints `does not conform` with the receipt's line, exit 1, with the rest of the report. No close receipt is not a failure: `complete: not claimed: this Accord has no close receipt`. Exit 3 is a tool or usage error.

**The Accord id must come from outside the material being checked.** `verify` takes the mediator's key from the founding set the id is a hash of, never from a receipt. An id read from the journal you were handed shows only that the journal agrees with itself. For the sample, this page stands in for your record. In real use the id comes from your own copy, made when you took part in the founding, or from someone you trust who did. A checker with neither cannot tie the journal to the Accord it is meant to be.

## Where to go next

- **Try one handoff end to end:** [`docs/guides/approve.md`](https://github.com/orilloai/placket/blob/main/docs/guides/approve.md), after `placket init approve`. `init` founds the example Accord for you alone and prints each next command. The guides use Claude Code as the agent and need no judge's key.
- **See a gate refuse, with no agent or account:** [`patterns/github-merge/`](https://github.com/orilloai/placket/tree/main/patterns/github-merge), a merge gate rehearsed against a stand-in for GitHub. Needs `placket` and `jq`, and writes keys where it runs, so use an empty directory.
- **Take part in an Accord:** [`docs/guides/claude-code.md`](https://github.com/orilloai/placket/blob/main/docs/guides/claude-code.md) (MCP tools), [`docs/reference/cli.md`](https://github.com/orilloai/placket/blob/main/docs/reference/cli.md) (commands).
- **Gate an action of your own:** [`docs/guides/appliers.md`](https://github.com/orilloai/placket/blob/main/docs/guides/appliers.md). Patterns supply appliers for a file write, a GitHub merge and a guarded export; any other applier is yours to write.
- **Check a record:** the section above, and [`docs/verify.md`](https://github.com/orilloai/placket/blob/main/docs/verify.md).
- **Source and releases:** https://github.com/orilloai/placket
- **The rest of the site:** https://placket.tech/llms.txt (index), https://placket.tech (for people).
