← Docs

Agents

How Claude Code and Codex use InputLayer, what the agent sees and when, and what it may and may not do.

InputLayer is built for the agent. The agent sees the guarantees before it edits covered code, can run a check at any point, gets a counterexample when it breaks something, and fixes the code. It cannot weaken what it is checked against. This page describes the Claude Code plugin, Codex over MCP, and the rules both follow.

Claude Code

Public install is not available yet.

The plugin has three parts: an MCP server with tools, skills that teach Claude when to use them, and hooks that run at fixed points in a session.

What Claude sees, and when

MomentWhat happensWhat Claude sees
Session startEvery guarantee that is not up to date is checkedOne line, which you see too: InputLayer is checking 1 guarantee: "Someone removed from a workspace can't see or change anything in it, even work that's already running." Holds. A suggested guarantee shows as InputLayer: 1 guarantee suggested, not active yet: ... with the il accept command
Before the first edit to covered codeThe plugin finds the guarantees whose checks cover the fileEach guarantee's sentence, bounds and what it leaves out, before the edit runs
Claude tries to edit .inputlayer/Once the project has guarantees, the edit is refusedWhy: guarantees and checks are not the agent's to change
After an edit to covered codeThe guarantee is marked out of dateWhich guarantees the edit touched, the steps whose lines changed, and what to do: move a step's anchor if the code still does what the step says, else repair the code, then call recheck. The Quickstart shows it
Claude calls check or recheckThe check runs on the guarantee's model. A model il derived is not checked after the code it watches changed: il derives it again at the next stopThe verdict in InputLayer's words; a holding result carries its bounds and what it leaves out, an out-of-date one says why
Claude tries to finishAnything out of date is checked. A reproduced break introduced by this task, or a pre-existing one whose path this task edited, blocks the stopThe counterexample, the bounds, and "repair the code, then call recheck"
After the third blocked stopThe next stop goes throughThe finding goes to you as needs your decision, with your options
Task doneThe summary is writtenNothing more: you see one line, such as InputLayer checked 1 guarantee: it holds.; each guarantee's verdict, bounds and what it leaves out, and what changed during the task, are in .inputlayer/last-task.md to paste into the PR

In a session, only a break that replays on the real code blocks. A break that does not reproduce is cannot tell, shown as needs your decision, and Claude is told to say so rather than keep trying. A break that already existed before the task started is listed and does not block. In CI, a break also fails the job when it was never tried on the code: there is no way to replay it, its test could not run, or its trace or replay ran out of time or could not be made (exit 1, cannot tell on the certificate). One that was replayed and did not reproduce does not (with --strict it exits 4).

The plugin compares content hashes, not tool events, so an edit by any route counts: the Edit and Write tools, a shell command, or another program.

Hooks

HookMatcherWhat it does
SessionStartChecks guarantees that are not up to date and prints one line. In a project with no guarantees, says so once and points to the protect skill
PreToolUseRead|Edit|Write|MultiEdit|NotebookEdit|BashShows the guarantees covering a file before the first edit to it. Once the project has guarantees, refuses Claude's direct writes to .inputlayer/
PostToolUseEdit|Write|MultiEdit|NotebookEdit|BashMarks guarantees out of date when covered code changed
StopChecks what is out of date, blocks while a guarantee is broken and reproduced (at most 3 times), then writes the summary
SessionEndRecords that the session is no longer open

The hooks run il hook <event>. If il is missing, the session starts with one line saying nothing is checked, and the other hooks stay out of the way.

MCP tools

The plugin's MCP server is il mcp. Claude sees each tool as mcp__plugin_inputlayer_inputlayer__<tool>.

ToolArgumentsWhat it does
statusEvery guarantee with its verdict, open change requests, and what this session checked
checkguarantee_id?Checks one guarantee, or all of them, on the code as it is
recheckguarantee_idChecks a guarantee again after an edit and records the result for the hooks
traceguarantee_idThe counterexample of a broken guarantee, step by step
anchorguarantee_id, step, path, start, endRe-ties a check's step to the lines of code it stands for, when that code moved
review_modelguarantee_id, reasonMarks nothing: gives the person the il protect review command and what to tell them. Only a person, in their terminal, marks a check as wrong; the guarantee is then cannot tell (under review)
change_requestguarantee_id, belief, kindFiles a change request and stops. kind is guarantee_wrong, conflicts_with_task or repairs_failed

Skills

SkillWhen Claude uses it
/inputlayer:checkWhen to call the tools, and how to read and report a verdict with its bounds
/inputlayer:protectSuggesting guarantees: finds two or three risky spots, writes each as a sentence with bounds and what it leaves out, and lets you pick
/inputlayer:statusEvery guarantee with its verdict
/inputlayer:auditAuditing a repository or a branch, reporting only breaks that reproduce on the code
/inputlayer:change-requestFiling a change request instead of working around a guarantee

Settings

VariableEffect
INPUTLAYER_HINTS=offTurns off the one-line hint in projects with no guarantees
IL_BINThe il binary the plugin runs, instead of the pinned build

Set them in your shell or in the env block of Claude Code's settings.

Codex

Codex uses InputLayer through MCP, with il mcp as the server. Public install is not available yet.

This needs il on your PATH. Codex gets the same tools as Claude Code. It does not get the plugin's hooks, so nothing refuses its edits to .inputlayer/ and nothing blocks it from finishing on a broken guarantee. Two things make up for that:

  • CI is the authority. The PR is checked against the base branch's guarantees whatever the agent did locally. An edit Codex makes to a guarantee file does not apply to its own PR and needs a code owner's approval.
  • Instructions. Add this to your AGENTS.md:
text
This repository has InputLayer guarantees in .inputlayer/guarantees.yaml.
- Before editing code, call the inputlayer `status` tool and read the guarantees that cover it.
- After editing, call `recheck` for each guarantee your edit touched.
- Do not finish while a guarantee is "broken, reproduced on the real code". Fix the code.
- Never edit anything under .inputlayer/. If a guarantee looks wrong, call `change_request` and stop.
- Report every result with its verdict and its bounds.

What the agent may and may not do

The agent owns the code. InputLayer owns the checks and the evidence. You own the guarantees.

The agent may:

  • read guarantees, checks, verdicts and counterexamples;
  • run check, recheck and trace at any point;
  • change the code to fix a break;
  • suggest guarantees, which are written as status: suggested and block nothing;
  • file a change request when it believes a guarantee is wrong, conflicts with the task, or could not be brought back in three repairs.

The agent may not:

  • edit a guarantee, a check, an evidence bundle or a change request, by any tool, including shell commands. Once the project has guarantees, the plugin refuses the write, and a change made some other way makes every guarantee cannot tell (changed_outside_il) until the files are restored;
  • accept a guarantee, or change its status: when Claude Code is open in the project, il accept is not enforced;
  • close a change request: il change-request close is refused without a terminal and inside an agent session;
  • override a break: only a person with write access can, with a comment on the PR (never give the agent a token with write access);
  • call review_model on its own, or to get past a blocked stop. The certificate records who marked a check as under review;
  • report a result without its bounds, or in stronger words than the verdict.

Words the agent uses

The agent reports each result with its verdict and its bounds, in the same words InputLayer uses: holds within bounds, broken, reproduced on the real code, cannot tell with the reason. For example: "removed-member-no-access: holds within bounds (one member, one workspace, one removal during one piece of work; each loop at most twice)". It does not say a change is correct, done, or safe beyond what the checks show, and it says what was not checked.

When repair is not the answer

When the agent believes a guarantee is wrong, that it conflicts with the task, or that it cannot be brought back in three repairs, it files a change request and stops instead of working around it. In the Quickstart, asked to let whoever started a job always read and cancel it, Claude filed one and asked the person to decide. il change-request show removed-member-no-access-1 prints it:

removed-member-no-access-1: open Protection: removed-member-no-access Why it was filed: the guarantee conflicts with the task What the agent believes: The task asks that whoever started a job can always read its status and cancel it by id. Current members, starters included, can already do that (app/routes/jobs.py checks require_member). The only new case is a starter who has been removed from the workspace, and the guarantee says a removed member can't see or change anything in it, "even work that's already running". The two can't both hold. Either the task should be limited to current members (no code change needed), or the guarantee needs an exception for a removed member's own jobs. Verdict when filed (unchanged by the request): holds within bounds (exit 0) Repairs tried: 0 this session, 0 over every session. Model: .inputlayer/models/removed_member.iql (sha256 6a5854eec5a7). Check removed_member_access: 0 violating row(s). To decide: change the guarantee in a reviewed edit, or keep it; then `il change-request close removed-member-no-access-1 --decision <guarantee-changed|guarantee-kept> --note "..."` in a terminal.

The request changes no verdict, and CI acts on the guarantee as before, until you change the guarantee in a reviewed PR or keep it, and close the request in your terminal. See Guarantees.

AI shouldn't certify its own code.

Public install is not available yet. The Quickstart shows what InputLayer printed on an example.

Rather we check one service for you first? Book an audit →