Security model
On this page
Clara keeps a project's board as Markdown files in its own repository and is driven by people
and by coding agents. This page says what Clara protects, from whom, how, and which test proves
each claim. It covers the items of the build brief's D15, and it says plainly which are built
and which are not yet. To report a problem, see SECURITY.md.
Who and what this is about
Clara runs on a developer's machine, with that person's rights. What it protects:
- The machine. Nothing a stranger wrote runs on it.
- The files outside the board. Clara reads and writes under
.clara/only. - Secrets. Tokens and keys never reach the board, which is committed and pushed.
- The board's integrity. Agents cannot finish work on their own say-so.
- Privacy. Nothing about the person or the project leaves the machine.
Who it is protected from:
- Whoever wrote a repository you cloned. They wrote its
.clara/config.yml, which can name commands, and every ticket in it. - Whoever wrote a ticket's text. That can be a person on another team, an issue imported from a stranger, or an agent that read something hostile. Ticket text is treated as hostile everywhere it is shown.
- An agent steered by what it read. Agents act through the same operations as people, under rules they cannot switch off.
- A web page open in the same browser, which can send requests to the local board server and point a domain of its own at this machine.
- Other programs and users on the same machine, which can reach the local server's port too, and send any request they like.
- The supply chain. That covers the packages Clara is built from, the actions that build and release it, and whoever controls a tag or a registry entry.
Out of scope: a person who already controls the machine or the user account, and a repository's maintainers acting through its normal permissions. Clara has no server and no accounts of its own, so there is no service to attack.
The items
| Item | State | Enforced in | Tested in |
|---|---|---|---|
| Paths | Built, attachments included. | library/storage/paths.ts, library/model/ids.ts, library/storage/fs.ts, library/model/attachments.ts, library/ops/attachments.ts |
test/security/paths.test.ts, test/unit/model/attachments.test.ts, test/unit/ops/attachments.test.ts |
| Commands | Built. The hosted board runs none. | library/conductor/trust.ts, cli/gates.ts |
test/security/commands.test.ts |
| Content | Built | cli/colour.ts, web/lib/markdown-html.ts, web/lib/markdown.ts, server/http.ts, server/app.ts |
test/security/terminal.test.ts, test/unit/web/markdown.test.ts, test/e2e/markdown.spec.ts, test/integration/server-attachments.test.ts, test/e2e/attach.spec.ts |
| Secrets in what checks print | Built | library/conductor/redact.ts |
test/security/secrets.test.ts |
| Agent settings | Built | cli/setup.ts, cli/config-edit.ts, mcp/channels.ts |
test/integration/cli-setup.test.ts, test/security/launcher.test.ts |
| Agents | Built: the review gate, trust, fencing, MCP identity, what an agent may edit, and a dispatched run's worktree, permissions and limits. The daily ceiling across runs and stopping a run from another terminal. The approval bridge, where the run's own agent never answers. Agents do everything but approve (D-157). | library/rules/, library/ops/, library/context/, mcp/server.ts, cli/gates.ts, library/conductor/ |
test/property/ops.property.test.ts, test/unit/context/render.test.ts, test/unit/ops/tickets.test.ts, test/unit/mcp/tools.test.ts, test/integration/mcp.test.ts, test/conformance/mcp.ts, test/unit/conductor/claude.test.ts, test/integration/dispatch.test.ts, test/integration/cli-start.test.ts, test/integration/work.test.ts, test/integration/cli-work.test.ts, test/integration/cli-runs.test.ts, test/unit/ops/asks.test.ts, test/unit/mcp/permission.test.ts, test/integration/review-agent.test.ts, test/integration/worktree.test.ts |
| The demo | Built | library/conductor/demo.ts, library/conductor/demo-script.ts, cli/demo.ts, cli/demo-agent.ts |
test/integration/demo.test.ts, test/integration/cli-demo.test.ts, test/security/commands.test.ts, test/security/privacy.test.ts, test/unit/conductor/demo.test.ts |
| Supply chain | Built. Publishing is a person's step. | package.json, package-lock.json, .github/workflows/ |
test/security/supply-chain.test.ts, scripts/pack-smoke.mjs |
| Privacy | Built | the whole package | test/security/privacy.test.ts |
| Local server | Built | server/http.ts, server/app.ts, server/index.ts, cli/serve.ts |
test/security/server.test.ts, test/unit/server/http.test.ts, test/integration/server.test.ts, test/integration/cli-serve.test.ts |
| Tokens | Built: GitHub's in the Action (M7), and the hosted board's (M8). Direct mode is not built (D-140). | cli/github/actions.ts, cli/github/action.ts, cli/github/work.ts, cli/github/land.ts, cli/github/handoff.ts, templates/workflows/, action/action.yml, server/hosted.ts, server/hosted-entry.ts, library/storage/github.ts |
test/integration/github-work.test.ts, test/integration/github-sync.test.ts, test/integration/github-action-entry.test.ts, test/unit/github/workflows.test.ts, test/unit/server/hosted.test.ts, test/integration/hosted-build.test.ts, test/unit/storage/github.test.ts |
"Built" means the behaviour exists, has a test under test/security/ (or the one named), and
runs in npm run ci on every change.
Paths
Rule. Ids, view names and every path the board uses are validated. No input reaches
outside .clara/.
- A ticket id is a key and a number (
WEB-12), or a bare number. A view name is made of file-name characters only. Anything else is refused before it is used as a path, and the refusal says which characters are allowed. - Storage builds every path from validated parts. It refuses absolute paths,
.., backslashes and Clara's private folders. The disk adapter refuses to follow a symbolic link anywhere inside.clara, and refuses a.clarathat is itself a link. A cloned repository cannot point Clara's writes at~/.ssh.
Tested by driving the CLI the way a stranger's input arrives: hostile ids and names at
every command that takes one, and repositories whose .clara or whose files inside it are
links.
Attachments (D14) are files a stranger's bytes become, so they are held tighter still:
- An attachment lives at
attachments/<ticket id>/<name>and nowhere else. The ticket id is checked as above, and must be a ticket's that is on the board. The name is never the one it came with: it is a lower-case slug of it, cut to 60 characters, with the extension of the type the bytes are, so../../.ssh/id_rsa.pngbecomesid-rsa.png. A name Windows keeps for a device (con,nul,com1) is prefixed withimage-. A name already taken gets-2,-3and so on, so nothing is ever overwritten. - The type is read from the first bytes, never from the name or a type a client claims, and only PNG, JPEG, GIF and WebP are kept. SVG is refused, since it can carry script, and so is everything else. An attachment is at most 3 MiB.
- Reading one checks the id and the name against the same patterns before any path is built, and checks the bytes again after: a file put there by hand that is not one of those images is not served.
Tested by test/unit/model/attachments.test.ts and test/unit/ops/attachments.test.ts:
traversal in the id and in the name, device names, de-duplication, the limit, SVG and HTML
dressed as images, through the memory and disk adapters.
Agent settings
Rule. clara setup <agent> writes outside .clara, into files a coding agent shares with
the people who use it, so it writes only what it names and only what is Clara's.
- The agent is one of a fixed list, and each agent's paths are fixed in the code. No other
input becomes part of a path. Without
--globalevery path is inside the repository; with it, inside the home folder, which comes fromHOMEorUSERPROFILEand is never guessed. - A link is followed only when it stays inside the repository, or the home folder (or the
folder
CODEX_HOMEorCOPILOT_HOMEnames). A link that leads out, a link that leads nowhere, or a folder where a file should be stops the run. - Each change is Clara's entry in a JSON or TOML file, Clara's block of lines between two markers, or a file in Clara's own skill folder. Comments, other entries, indentation and line endings stay as they were. A file Clara cannot read for sure, such as JSON with a mistake in it, a block with one marker missing, or a TOML table of the same name that a person wrote, is refused rather than guessed at.
- Every file is planned before any is written, so one refusal writes nothing at all. Each file is written whole: a new file beside it, renamed over it, with its permissions kept.
- What it writes is Clara's own text: the working agreement, the guide and the server's command. No ticket text reaches an agent's instructions file this way.
- A skill folder named
clarais rewritten only when Clara wrote it: itsSKILL.mdcarries the noteclara setupleaves, or the plugin's, or nothing is there yet. A skill of that name a person wrote stops the run, which writes nothing (D-082). - An entry is added before a
//comment that ends its line, never inside it, and every file is read back before it is written: if Clara's entry or any other value would not read back as it was, the file is refused. - Which
clararuns. npx runs theclarathat the project around its folder installs, fetched from the registry that project's.npmrcnames. A repository's own settings (.mcp.json,.cursor/mcp.jsonand the rest) already choose what runs in it, so they keepnpx -y clara mcp, which also runs the version the repository installs. The plugin and the settings--globalwrites start Clara in whatever repository is open, so they give npx a folder of their own to look up from:npx -y --prefix <folder> clara, with the plugin's own folder or the home folder. A repository opened later cannot plant theclarathat runs, or the registry it comes from (D-086).
Tested by test/integration/cli-setup.test.ts: a link out of the repository, a link
inside it, a file's permissions, broken JSON and broken markers that leave every other file
unwritten, a missing home folder, a clara skill a person wrote, and goldens of each agent's
files before and after. test/unit/cli/config-edit.test.ts writes Clara's entry into
generated JSONC layouts, comments included, and reads every value back.
test/security/launcher.test.ts runs the real npx, offline, on the plugin's commands and on
the settings --global writes, from a repository that plants its own clara and registry,
and shows the planted one never runs, while the plain command would run it.
Limit. Until the owner holds the name clara-ipm on npm, a lookup by that name finds another
publisher's package (docs/LAUNCH-CHECKLIST.md, step 1).
Commands
Rule. Nothing from a repository's config runs without trust (D8).
A board can name checks (
config.checks), setup commands, a router command, and the command of a custom agent (commandin an agent profile). Clara runs none of them until a person on this machine has seen them and said yes, either at the prompt or withclara trust --yes.The answer is stored in
CLARA_HOME/trust.json, outside the repository, with a digest of the commands. If a pull or a hand edit changes any of them, Clara asks again.Trust is never taken from the repository or from an environment variable, and never from an agent, which may have read a ticket written to get those commands run. An agent, named by
--as agent:<name>orCLARA_ACTOR, can read the commands and can take trust away. It cannot give it:clara trust --yesrefuses it, and at a terminal it is not asked. Without trust, a check is refused, and the refusal says what a person runs to grant it.Once trusted, a check runs as the person, in their shell, with a time limit (
timeout_s, 600 s by default). Clara keeps only the last 64 KB of what the check prints.Reading what a ticket's branch changes, for the review room, runs
git diffwith--no-ext-diffand--no-textconv, so no diff program named in git's config runs. A run's worktree shares the main checkout's git config, so a program written there, by hand or by an agent in a looser profile thanguarded, would otherwise run as the person when they review. The branch is checked as a branch name, which cannot start with a dash, before git sees it (D-115).Limit. Landing approved work runs
git mergeorgit push, and git runs the hooks the repository's config names for those, as it does for any git command the person runs. Clara does not turn them off: a person's own hooks are theirs to keep. A guarded agent may not rungit config, and the file is outside its worktree. The reads it may run cannot write it either: git's--outputand a redirection are refused, as the next section says.A worktree's git files are checked before git runs there again. A worktree's
.gitis a file that names its git folder. An agent that can write in its worktree can point it at a folder of its own, whose config names a program for git to run, such ascore.fsmonitor, whichgit statusruns. Before Clara runs git in a run's worktree after an agent, to read what it left uncommitted, to open the worktree again or to start the reviewer, it checks that.gitnames one of the repository's own worktree folders, that the folder names that worktree and that repository back, and that it has no config of its own. When one of these does not hold, no git runs there: the run fails and the ticket is blocked, the worktree is not opened again, or a person reviews the ticket.Tested by the fake agent pointing
.gitat a git folder it wrote, whose program would leave a mark: the run fails, the ticket is blocked and there is no mark (test/integration/dispatch.test.ts); no reviewer started when the files change after the run (test/integration/review-agent.test.ts); and each way the files can change, with a worktree that is not opened again (test/integration/worktree.test.ts).Limit. The check is made just before git runs, so a program the agent left running could change the files in between. The board's checks run code the agent wrote in any case, as the agent. git reads
config.worktreeonly when the repository turns onextensions.worktreeConfig; Clara refuses the file either way. git still runs the hooks and filters the person's own config names.
Tested by cloning a repository whose check would leave a mark if it ran, then trying every
command, as a person and as an agent, with and without a terminal or --json. The tests also
cover a pull that changes a command, setup commands, a custom agent's command, where the
answer is stored, attempts to get trust from the environment, and every way an agent could try
to give trust (test/security/commands.test.ts, test/integration/custom-agent.test.ts). The
diff is read in a checkout whose config names a text conversion and an external diff that
would each leave a mark, and neither does, while a plain git diff there leaves it
(test/integration/git-reader.test.ts).
Not built. The hosted app (M8), which will run nothing at all.
Content
Rule. Ticket text is written by agents and strangers, so it is treated as hostile.
- In the terminal, hostile text means control characters. They can clear the screen, set the window title, write to the clipboard, or overprint a line so it reads as something else. Clara lets through nothing but its own colour codes, line feeds and tabs. It strips this from every field and every argument it echoes, and from errors and confirmations too.
--jsonkeeps the text whole and escaped. A program reading it gets exactly what was written.
Tested by putting hostile text into every field the board holds and into the arguments, then running every command that prints.
In the browser, hostile text means Markdown that would run script, load something from another host, or send the person somewhere other than the web.
- Raw HTML is text. HTML written in a ticket, a comment or a title is shown as what it
says, never made into elements (
web/lib/markdown-html.ts). - Links go to the web or mail only. A link opens only an
http,httpsormailtoaddress, in a new tab, with no opener and no referrer. Any other link,javascript:,data:andvbscript:among them, however it is spelled, is shown as its words. - Nothing loads from elsewhere. An image is shown as a link to it. The one image drawn is
an attachment of this board,
attachments/<ticket id>/<name>held to the attachment pattern, and it is drawn with no address. The page fetches its bytes from the board's own server, with the key, and gives the image ablob:address of them.srcis not an allowed attribute, so no text can give an image an address of its own. - What runs bring is text. A run's log, the summary an agent hands in, a branch's diff
and the command an agent asks leave to run are written by agents or by whoever wrote the
code they read. The page shows each as text, never as Markdown or HTML, and a log line or
a diff line that looks like a link is not one (
web/views/runs/,web/views/review/,web/components/ask.tsx). - Checked twice. The HTML that comes out is put through DOMPurify against a short list of
tags and attributes, with links held to the same schemes, before it is set
(
web/lib/markdown.ts). A mistake in the first half still meets the second. - A strict policy. Every response carries a content security policy that runs only the
server's own scripts and styles, inline ones refused, loads nothing from another host,
submits no form and lets no site frame the page (
server/http.ts). Text that got past both halves still could not run.
Tested by test/unit/web/markdown.test.ts, which holds the renderer to each rule, and by
the journeys in test/e2e/markdown.spec.ts, in a real browser against a real server: a ticket
holding script links in six spellings, raw <script>, <img onerror>, <svg onload>, an
<iframe> and a tracking pixel is added with the CLI and opened. Nothing runs, no dialog
opens, no request leaves for another host, the only links left go to the web, and its task
boxes still tick into the file. A hostile comment arriving live runs nothing either, and
script put into the page by hand is refused by the policy.
Secrets
Rule. Secrets never enter the repository, the logs, fixtures or the docs (B5).
- What a failing check prints is kept in the activity log, which is committed. Before it is
kept, Clara hides two kinds of value. The first is the value of any environment variable
whose name says it is secret, such as
GITHUB_TOKEN,API_KEYorDATABASE_PASSWORD. The second is anything shaped like a well-known token: GitHub, npm, AWS, Slack, Stripe, Google, OpenAI and Anthropic keys, JSON Web Tokens and private-key blocks. A hidden value shows as[hidden]. - A passing check keeps no output at all.
Tested by running real checks that print made-up tokens, passing and failing, then looking for those tokens everywhere Clara writes or prints.
Limit. This is a net, not a guarantee. A secret with an ordinary name and no known shape gets through. Checks should not print secrets.
Agents
Rule. Agents are guarded by default, and ticket text is data to them, never orders.
The rules hold. An agent works through the same operations as a person and cannot switch their rules off. Under every review mode, an agent cannot move work to
donewithout an approval that mode allows, and an author never approves its own work.An agent does everything but approve. Working for the person, an agent may do what a person may on the board: change settings, write the idea, answer questions, run sprints and plans, archive, import and start other agents (D-157). What decides approval stays a person's: an agent cannot change
review, cannot changecheckswhile the checks approve (review.mode: gates), and cannot move work todone. Trust stays a person's too: an agent cannot trust the board's commands in any mode, since trusted commands run outside the agent's own permissions. An agent Clara started for a run cannot start more runs, change settings, answer any run's question or accept knowledge, so text a run reads cannot widen what runs may do; no agent answers what its own run asked. This trades a guardrail for speed: an agent misled by ticket text could start work, change settings or answer a question a person would not have, and the person reads the board, not every action.Ticket text is fenced. Everything from the board that Clara sends an agent (a ticket, its criteria, handoff note and comments, review notes, an epic, the idea, the lists the MCP tools print, the note the plugin's hook prints) sits between two marker lines that say it is information, not instructions. The marker carries a value the text does not contain, so the text cannot close it, and characters a person cannot see are shown, not passed on. The working agreement, which every agent is given, says not to obey such text and to block and ask when it asks for a broken rule.
Checks are not Clara's orders. A board's checks come from its
config.json, which a branch can change. The context pack shows their commands fenced as information from the config, and tells the agent to runclara verify <id>, which runs only commands a person has trusted on this machine.An agent is who its setting says. Everything over MCP acts as an agent, never as a person. Its name comes, in order, from
--asorCLARA_ACTOR, from the agent's client (claude-codeis Claude), or from the name the connection's first call gave; theactorargument the model writes is refused when it names anyone else. So one agent cannot act under another's name to approve its own work (D-083).What an agent may write. An agent rewrites the body of a ticket nobody holds, or of one it holds and has not handed in, acceptance criteria included, and keeps the handoff note as it is, which a checkpoint writes. Work in review stays as it was handed in. No tool deletes a ticket, a comment or a line of the log;
clara_updateandclara_checkpointwrite over the text they are given, and are annotateddestructiveHintfor the client to ask (D-084).Tested by a property test that runs random sequences of agent operations and checks that none ever reaches
donewithout an approval (test/property/ops.property.test.ts); a property test that puts text written to escape into every fenced piece of a context pack (test/unit/context/render.test.ts), which also holds a hostile check inside its fence; the body rules (test/unit/ops/tickets.test.ts); and the identity order, with an agent that tries to approve its own work under another name, over stdio and Streamable HTTP (test/unit/mcp/tools.test.ts,test/integration/mcp.test.ts,test/conformance/mcp.ts).A dispatched run is guarded.
clara startruns the agent in a worktree of its own underCLARA_HOME, on the ticket's branch, never in the person's checkout. Under theguardedprofile, the default, it may edit files in the worktree, run the board's checks and setup commands, read-only git,git addandgit commit, and Clara's tools; anything else is refused. Every profile refusesgit push, force and history rewrites, worktree changes andgh pr createormerge, and theopenprofile is not started at all. The ticket text in the prompt is fenced, and the run's own rules tell the agent not to push and to stop when done. Each run has a limit on minutes, turns and spend; at the time limit the agent gets SIGINT, then SIGTERM, then SIGKILL, by process group, and so do the run's checks when they are still going. Its output is kept with secrets masked. A run's own agent cannot start another run (D-103, D-157).The checks run the agent's code as the person. A check such as
npm testruns what the agent wrote, outside any agent's rules, with the person's rights, as CI would. Clara runs it as the agent,CLARA_ACTOR=agent:<name>, soclaracalled from it cannot approve or trust as the person; code that clears the variable is not stopped. Read the diff of work from an agent you do not trust before its checks run, or run them in a container.A read cannot write. A rule that allows
git logwith any arguments would allowgit log --output=<file>andgit log > <file>, which write any file the person can, as the person: their shell's startup file, or git's config. A rule over the words cannot refuse them however they are quoted (--out""put), so a Claude Code run also has a hook of Clara's, written for the run, that reads each shell command as the shell does, with quotes and escapes removed, and refuses before the rules are asked: any redirection but to/dev/nullor another stream, a git command naming--output, and a git command with$or a backtick that could become anything. It holds in every profile butopen, which may write anything anyway. OpenCode and Gemini CLI get rules refusing a git command with--outputor>in it; Copilot CLI, whose rules match only the start of a command, may rungit diff,log,showandblameonly with no arguments; Codex and Cursor are held by their sandboxes, which take writes only in the worktree and the folders a commit needs.Tested by the permission rules for each profile (
test/unit/conductor/claude.test.ts), and the fake agent of E1 run through every way a run ends, a refused command among them, with the limits, a stop that ignores the interrupt, and an agent refused the right to start a run (test/integration/dispatch.test.ts,test/integration/cli-start.test.ts). The fake agent runs the hook as Claude Code does, and tries--out""put=<file>and> <file>in a real shell, which write nothing (test/integration/dispatch.test.ts); the check is tested against each way of writing them, and the hook as the program it is (test/unit/conductor/refuse.test.ts), and the other agents' rules in their own tests.Limit. These guards hold for an agent that works through Clara. An agent with a shell in the repository can edit
.claraby hand, or runclarawithout--as; a person reviews such work in the pull request. The permission rules are Claude Code's own, which Clara writes and Claude Code enforces; the other agents' are below. Claude Code also loads the person's own~/.claude/settings.json, so what the person allows themselves without asking, a guarded run may do too, and their own hooks run. Clara's refusals hold whatever it allows, since a refusal wins, and a read-only run is refused the editing tools outright.A custom agent is only as guarded as its own flags. The
customadapter starts a command from the agent's profile (D-108). It is trusted like a check before it runs, and it is started without a shell: its template is split into words by Clara, and whatever fills a placeholder, the ticket text among it, is one argument, so no ticket can add a command or an option. It still works in a worktree of its own, within the time limit, and its work reaches review only through the checks. Clara cannot hold it toguarded: it may do anything its own flags allow, and its rules can only ask it not to push. It reports no spend, so the spend limit cannot stop it. It is never started as a reviewer, since nothing can make it read-only.Tested by the template's splitting and filling, with a property test that hostile text stays one word (
test/unit/conductor/custom.test.ts), and a command run through every way a run ends, untrusted, changed after trust, and as a reviewer (test/integration/custom-agent.test.ts).No agent is started through a shell, on Windows either (D-114). Windows starts an npm installed agent, a
.cmdscript, only through cmd.exe. Clara finds the script onPATHitself, never in the folder the agent runs in, which is a worktree the agent can write to. It then gives cmd.exe the script's path and each word escaped for both of cmd.exe's readings of it, so&,|,%,!,^and quotes in a word stand only for themselves. A word with a line break cannot be escaped for cmd.exe, so it is refused before anything starts. The probe that asks an agent for its version starts it the same way.Tested by a property test that any word comes through both readings as itself, with nothing left for cmd.exe to act on, the search order on
PATHfor each system, and on Windows awkward words passed through a real.cmdscript and the smoke script's run of aclaude.cmd(test/unit/conductor/launch.test.ts,test/integration/claude-smoke.test.ts).The other agents are held by their own controls. The adapters for Codex, Gemini CLI, Antigravity CLI, Cursor CLI, OpenCode and Copilot CLI are written from each agent's documentation, not yet run against its real CLI, and labelled so wherever Clara shows them (D-112). Clara gives each the strongest controls it documents, for the one run, and writes nothing into the repository or the person's home. What holds each profile:
Agent guardedread-onlyautoPushing refused by a rule Codex workspace-writesandbox, no network, plus the run branch's commit foldersread-only sandbox its reviewer ( --approve-for-me)no; its sandbox has no network Gemini CLI auto_editand an admin-tier policy of Clara's (--admin-policy) allowing git's reads, committing and the board's commandsplanheld as guardedyes, in every profile Antigravity CLI --mode accept-edits; commands need the person's own settings to allow them--mode planheld as guardedno; a headless run refuses any command its settings do not allow Cursor CLI its sandbox, plus the run branch's commit folders --mode askheld as guardedno; its sandbox, as Cursor documents it, keeps commands off the network OpenCode inline rules ( OPENCODE_CONFIG_CONTENT) that ask about everything, then allow reading, edits in the worktree, git's reads, committing and the board's commandsreading, searching, git's reads and Clara's tools held as guardedyes, in every profile Copilot CLI --allow-toolfor writing, git's reads, committing, the board's commands and Clara's toolsgit's reads and Clara's tools its reviewer ( --assisted-approval)yes, in every profile, --allow-allincludedA headless run cannot answer a question, so what a profile does not allow is refused. Only Claude Code takes a turn and a spend limit: for the others only the run's time limit binds. Codex, Gemini, Antigravity and OpenCode report tokens, and only OpenCode spend, so the daily ceiling counts a run of the others at its spend limit while it goes and at nothing after. Gemini, Antigravity and Cursor take Clara's tools only from a file in the repository, so their runs have none and end with a last message, which Clara reads.
An agent's own files are trusted like a check. Each of these agents reads files of the repository by itself that can start programs or allow it more:
.codex/,.gemini/,.agents/mcp_config.json,.cursor/,opencode.json,opencode.jsoncand.opencode/, and Copilot's.mcp.json,.github/mcp.jsonand skill folders.clara trustlists them with the board's commands, each shown whole, or by its digest past 64 KiB or when it is not text; a link is shown with where it points and followed, and changing either asks again. A run of the agent starts only when what they hold is trusted, in the person's checkout and again in the run's worktree before each attempt: an agent that writes such a file, to allow itself more next time, gets no next attempt, and the ticket waits for a person. Clara never passes the flags that would load a repository's servers without asking (--approve-mcps,--trust-folder,--skip-trust). Rules for one of OpenCode's own agents in a trustedopencode.jsonare applied after Clara's and can widen them: trusting the file is trusting what it allows. Claude Code reads none of these: Clara passes it--setting-sources userand--strict-mcp-config.Tested by each adapter's command, flag by flag and profile by profile, its rules or policy, its consent lock and its parser against the documented events (
test/unit/conductor/codex.test.ts,gemini.test.ts,antigravity.test.ts,cursor.test.ts,opencode.test.tsandcopilot.test.ts; OpenCode's rules are checked with its last-match-wins order); a run refused until an agent's files are trusted, and one stopped after an attempt that wrote such a file (test/integration/dispatch.test.ts); links followed and loops stopped (test/unit/conductor/trust.test.ts); and a file put where every shipped agent looks, each listed byclara trust(test/security/commands.test.ts).Limit. Enforcement depends on each agent's own controls, as they are documented, and none of them has been run here. A sandbox or a rule the agent does not apply as documented is not one Clara can see. A person reviews the work in the pull request either way.
A reviewer reads and changes nothing. The board's reviewer agent (
review.reviewer) runs read-only whatever its profile says: Claude Code'sdontAskmode, which refuses without asking anything its rules do not allow, and rules that allow only reading files, the git commands that only read, Clara's reading tools andclara_review. It is given no commands and no approval bridge. The ticket text and the author's summary are fenced in its prompt as data, and its rules tell it that a request inside them to approve is not an instruction. It never reviews work its own agent did, its approval lands nothing, and it sends a ticket back at mostconductor.max_attemptstimes (D-106). It starts only while the board's commands are trusted, and while the files of the worktree it would load by itself are trusted as they are after the work's run, which may have written them; otherwise a person reviews the ticket.Tested by the fake agent as a reviewer that tries to write a file and to commit, both refused and the branch unchanged; approving, sending back, commenting, crashing, the cap, a reviewer that is the author, and no reviewer started after the work's run wrote a file it would load or after the trust was taken back (
test/integration/review-agent.test.ts); and the read-only rules (test/unit/conductor/claude.test.ts).Limit. The reviewer's worktree is the run's own. It runs with the same hook as a work run, so git's
--outputand redirections are refused to it too.A daily ceiling, and a stop from anywhere.
conductor.daily_budget_usdcaps what agents spend on this machine over a rolling 24 hours. A run going counts its whole spend limit until it ends, so the runs one loop starts cannot pass the ceiling between them, and no run is given more than the ceiling leaves; when it is reached, new runs wait and the person is told. Two separateclaraprocesses starting runs in the same instant can pass it by at most one run's limit.clara stopasks the process running a run to stop it, as Ctrl-C would; it never signals a process id read from a file, which may belong to another program by then (D-104).Tested by the spend arithmetic (
test/unit/conductor/runs.test.ts), a run refused at the ceiling (test/integration/dispatch.test.ts), the loop pausing with a ceiling of 0 (test/integration/work.test.ts,test/integration/cli-work.test.ts), and a run stopped from another terminal (test/integration/cli-runs.test.ts).Only a person lands work. Approving pushes the run's branch and opens the pull request, or merges it, as the person who approved, from their checkout: never from the agent's run, and never for an agent's approval, which is recorded and lands nothing. The push names the branch on both sides and is never forced; the merge happens only on the base branch, in a checkout with nothing uncommitted, and only when it merges cleanly. Rejecting deletes only the branch Clara made for the run, and only after a yes (D-105).
What lands is what was judged. Completing records the branch and commit handed in, and approving lands that branch at that commit and nothing else: the push and the merge name the commit, and a branch that has moved since it was handed in is refused before anything changes, so no commit the checks and the review did not see is landed. An agent names a branch or a pull request only on a ticket it holds and has not handed in, so one agent cannot point another's approval at its own work.
A pull request body is defused. It is made from ticket text, and GitHub acts on what it reads there, so every mention gets a zero-width space after its
@, and every closing keyword before an issue (fixes #12,Closes: acme/app#3,resolves https://…) one after the keyword: no one is notified and no issue is closed by text an agent or a stranger wrote. The text reads the same.ghis run with its prompts and update check switched off, with the body on standard input, never on the command line, and what it says when it fails is shown with secrets masked.Tested by the landing against a bare remote and a fake
ghthat records what it was given (test/integration/land.test.ts,test/integration/cli-review.test.ts), a branch moved after it was handed in and a ticket pointed elsewhere (test/integration/land.test.ts,test/unit/ops/tickets.test.ts,test/unit/ops/workflow.test.ts), the body and the defusing (test/unit/conductor/land.test.ts), the git calls themselves (test/integration/branch.test.ts), and a test that the only push in Clara is the one inlibrary/git/branch.ts, called only from landing (test/security/privacy.test.ts).A person answers what the rules do not decide. In a
guardedrun, a tool or command the rules neither allow nor refuse is not run until a person says so. The agent's CLI asks throughclara_permission, which only the server a run started offers, and the terminal running it,clara workandclara runsshow the question in one line, with what the agent wants masked for secrets and cut to 4,000 characters. A person answers withclara alloworclara denyon the machine running the run. The run a question belongs to comes from the server Clara started (CLARA_RUN), never from the model; only that run's agent can ask, and only while the run is going. A person, or an agent working with them, answers; the run's agent runsclarawithCLARA_ACTORnaming it, so its ownclara allowis refused, as is anyclara allowfrom an agent withCLARA_RUNset (D-157); underguardedthat command is itself one the bridge would put to a person. A run has at most three questions waiting, each waits at most ten minutes and is then denied, and whatever is still waiting when the agent stops or the run ends is denied. The question and its answer stay in.clara/.local/on that machine; the board does not change (D-107).Tested by the operations, with a model that names another run, an agent asking in a run not its own, the time limit and the cap (
test/unit/ops/asks.test.ts); the store and the conductor's watch (test/unit/conductor/asks.test.ts); the tool over MCP, offered only inside a run and answering refusals as denials (test/unit/mcp/permission.test.ts); the fake agent asking through a realclara mcpand doing as told, allowed, denied, and stopped while it waits (test/integration/dispatch.test.ts); andclara runs,clara deny, and an agent refused when it answers itself (test/integration/cli-runs.test.ts).Limit. The bridge hears only what the agent's CLI asks it: what its rules allow or refuse never reaches a person, and how a tool's input is matched against a rule is Claude Code's. Under
auto, Claude Code's classifier decides what reaches the bridge, and an agent whose shell runs freely could runclara allowwithoutCLARA_ACTORand answer its own question. A run's time limit keeps counting while the agent waits.
The demo
Rule. clara demo (D-111) runs agents for real, so it is held to the rules above, and it
leaves nothing of the person's changed.
- It works in a folder of its own. The demo's repository, its trust, its worktrees and its
runs are all in one
clara-demo-*folder in the OS temporary directory, with aCLARA_HOMEof its own. The person'sCLARA_HOMEis never written, and the folder is removed at the end, on Ctrl-C and on a failure, unless--keepasks to keep it. - Its git settings are its own. The demo's repository names its lead as the committer, switches off commit signing and points hooks at an empty folder, so no signing key is asked for and none of the person's hooks run in a repository they never made.
- It trusts only its own commands. The demo gives trust to the checks of the board it has just made from Clara's own template, in its own home. It is the one place Clara gives trust without a person's yes, and it grants nothing in any other folder or home.
- It is labelled. The terminal's first line, and a banner on every screen of the page, say it is a simulation: scripted agents, not real ones, on a made-up project. No model is called and no key is needed.
- The page is the person's, as the lead. The demo's page is served like
clara serve's, with every rule of Local server, and acts as the project's lead, who may answer and approve before the scripted lead does. - Its agent keeps to its worktree. The scripted agent works through Clara's real MCP server, as an agent, in its run's worktree. It writes only files under the project (a script that names any other path is refused), commits there, and has no code that pushes or reaches a remote.
- Tested by making the demo with the temporary directory moved, and checking that the
person's
CLARA_HOMEstays empty after a full run, with the CLI and without (test/integration/demo.test.ts,test/integration/cli-demo.test.ts); that the folder is gone after a run, a stop and a broken template; the trust it gives, by reading the source for every place trust is granted (test/security/commands.test.ts); the git it runs and the programs it starts (test/security/privacy.test.ts); and a script that writes outside the project (test/unit/conductor/demo.test.ts).
Supply chain
Rule. No install scripts, no native modules, a committed lockfile, actions pinned to commit hashes with least-privilege permissions, and publishing with provenance.
- The package has no runtime dependencies (zod is bundled at build time), no install scripts and no native modules. Installing it runs nothing.
package-lock.jsonis committed. Every package in it resolves to the npm registry with asha512integrity hash. CI installs withnpm ci --ignore-scripts, so no development tool's install script runs either.- Every action in
.github/workflows/is pinned to a full commit hash, with its version in a comment. Tools the workflows install are named by version: Node by its major line, whose updates are security fixes, and Bun exactly. Every workflow reads by default, and a job may write only what an allowlist in the test names: CodeQL uploads its findings; Clara's board comments on a pull request and its sync commits the board; Pages deploys; release-please opens the release pull request and creates the release, in a job that checks out and runs nothing; the major tag job moves one tag through the API; and the two publish jobs prove their identity to npm. Checkouts do not keep the token on disk. Values a stranger can type, such as a pull request's title, reach scripts only through the environment, never pasted into the script. The onepull_request_targetworkflow checks out nothing and runs nothing. release.ymlpublishes withnpm publish --provenance, only after a person merges the release pull request and only while the repository variableCLARA_PUBLISHistrue; it checks the version againstpackage.jsonand runs every gate first. A person can also start it by hand, as a dry run unless told otherwise.canary.ymlpublishesnextbuilds behind the same variable. Both use npm's trusted publishing, so no long-lived token is stored.
Tested by reading the manifest, the lockfile and the workflows as committed, and by
scripts/pack-smoke.mjs. That script installs the packed tarball offline and checks it has no
dependencies and no install scripts.
A person's step. Setting up trusted publishing and the first release; see
LAUNCH-CHECKLIST.md. Development tools such as esbuild and Biome ship
native binaries. They are build-time only and never reach the published package.
Privacy
Rule. No telemetry, no update checks, and no network calls beyond the ones the user configured.
- Clara makes no network call. The source loads none of Node's network modules.
clara servelistens on 127.0.0.1 for the person's own browser and calls nothing. Programs are started from thirteen files only, each for a reason a person chose: git, about the checkout and the worktrees runs work in; the person's editor; their browser onclara serve --open; the board's checks and router, once trusted; the agent CLIs the person installed, asked their version and whether they are signed in (clara agents), and started in a run's worktree; theghthey signed in to, to open an approved ticket's pull request; on Windows,taskkill, to stop what Clara started; and forclara demo, git in the demo's own temporary repository, and Clara's own MCP server for its scripted agent. clara agentsreads only whether an agent CLI is signed in. The account it is signed in with is never shown, logged or kept, and a custom agent's command is never run to find out whether its program is there.- git is asked only what the checkout can answer: about the repository, the worktrees runs work in, and the branches they leave. It reaches a remote once, to push an approved ticket's branch when the board lands work as a pull request, and that push is a person's approval. Pulling is the person's own git command.
- On this machine Clara writes only in the repository and in
CLARA_HOME: trust intrust.json, the boards the CLI remembers between commands incache/(D-042), a mark naming the folder of each board used inprojects/(D-166), the worktrees runs work in, and, oncecache/exists, the code Node compiled of Clara incache/node(D-123).clara demowrites none of these in the person'sCLARA_HOME. - What a trusted check does is up to the person who trusted it.
Tested by running every command, as a person and as an agent, from init through a
release, with sockets, name lookups, UDP and fetch trapped. The trap must stay empty, and
the test first proves the trap catches a call. A second test reads the source for network
modules, for the places that start programs, and for every git command and the one push.
test/unit/conductor/agents.test.ts and test/integration/cli-agents.test.ts check that
the account an agent CLI is signed in with never reaches clara agents, text or JSON, and
that a custom agent's command never runs there. test/unit/node/home.test.ts checks that
the compiled code goes only under CLARA_HOME/cache, only once that folder exists, and never
for the demo.
Local server
Rule. The local server binds to localhost only, rejects requests whose Host header is
not local, rejects cross-site writes, requires JSON and limits body size (D15). Clara adds a
key, because a browser is not the only thing that can reach a port on this machine.
clara serve puts the board in a browser. Each check below runs before anything reads the
board, in this order:
- This machine only. It listens on
127.0.0.1and nowhere else: not0.0.0.0, not::, not the machine's address on its network. - Its own name only. Every request, for a page, a script or the API, must name the server
as
127.0.0.1:<port>,localhost:<port>or[::1]:<port>. A site that points a domain of its own at 127.0.0.1 (DNS rebinding) sends its own name, and gets 403 with nothing set. - Writes from its own page only. A request that can change something must carry an
Originthat is exactly the server's own. If the browser sendsSec-Fetch-Site, it must saysame-origin. A write with noOriginis refused, since every browser sends one on afetchthat writes. - JSON only. A write must say
application/json. The three kinds of body a form on another site can send without asking (text/plain,application/x-www-form-urlencoded,multipart/form-data) are refused. A site that asks to send JSON triggers a preflight, which the server never answers with a CORS header, so the browser sends nothing. - A megabyte at most. A body that says it is over 1 MiB is refused with 413 before any of
it is read. Any other is counted as it arrives, since the length it states is not believed,
and cut off with 413 at the first byte over, whether or not it arrives in chunks.
attachment.addalone may send just over 4 MiB, the most a 3 MiB image is in base64. It is an operation like any other, so it passes every check here; a body was chosen over a multipart upload so that it does not need a door of its own (D14). - Attachments as they are.
GET /api/attachments/<id>/<name>needs the key like every read. It answers with theContent-Typeread from the bytes, never one from the name,nosniff, andContent-Disposition: inlinewith the checked name. The content security policy lets images come fromblob:addresses, the page's own, for these and nothing else new. - The key. Other programs and other users on this machine can reach 127.0.0.1 as well,
and they can send any
HostandOriginthey like. So each start makes a new 256-bit key. The linkclara serveprints carries it after#(http://127.0.0.1:25272/#key=…), and a browser never sends that part of a link to any server. The page reads it, keeps it in its own storage, takes it out of the address bar, and sends it in anX-Clara-Keyheader with every call. A link with a new key opened in a tab that has the page already reloads it, so the old key is not kept by mistake. Every call to the API and the live updates needs that header, compared in constant time; the key in a cookie, a query or anAuthorizationheader counts for nothing. The page itself (its HTML, scripts and styles) needs no key, since it holds no data. - Why not a cookie. Browsers send a cookie for 127.0.0.1 to every port on it, so any other server the person runs there, such as a development server, would receive the key. A page's storage belongs to its origin, port included, and a header is sent only to the server the page's own script calls. Another site cannot add the header without a preflight, which is never granted. The cost is that a script running in the page could read the key, so the page runs only its own scripts (the content security policy below) and sanitises all Markdown.
--open. A program's arguments can be listed by other users of the machine, soclara serve --opennever hands the system's browser the link, nor any secret that could be traded for the key. It writes a page that sends the browser on to the link into a new folder in the temporary folder, readable by this user alone (0700, the file0600), and hands the browser that file's path. The file is deleted after a minute, or when the server stops.- What it sends. Every response, refusals included, carries a strict content security
policy: nothing loads from anywhere but the server, no inline script or style runs, and no
site may frame the page. They also carry
nosniff,no-referrer,X-Frame-Options: DENY, and same-origin opener and resource policies. Answers from the API are never cached. - Only the app's own files. The built web app is read into memory when the server starts. A request path is looked up among those files, and is never joined to a folder, so no spelling of a path reaches another file.
- Who it acts as. It acts as the person who started it, as their commands do. The page may
do what only a person may, so an agent never sees its key. An agent may start it only with
--open(elsePERSON_ONLY): it then acts for the person at this machine, named by git or the login whatever--asorCLARA_ACTORsays, the link goes to the browser through the file above and nowhere else, and the agent is told the address alone, which opens nothing. If no browser opens, the server closes, since nobody holds the link (D-156). This keeps the key out of what the agent reads; it is not a wall against code the agent runs as the person, which could read that file in its minute, or runclarawithout--as, as Agents says of checks. It offers the operations of the REST door. Those are everything a person can do at the command line exceptinit,migrateand recording a verification, which onlyclara verifydoes after running the checks. Nothing it offers can grant trust to a board's commands (D8). That takesclara trustat a terminal. Approving there lands the work asclara approvedoes, with the same refusals before anything changes (D-115,test/integration/server-approve.test.ts). - Other projects (D-166).
GET /api/projectslists the boards this machine's marks name, read as the person, andPOST /api/projects/openserves one of them from the same process. It passes every check above, and opens a board only when the folder it is sent is exactly one the marks underCLARA_HOME/projects/name; any other string is refused withNOT_FOUNDbefore a path is opened, so a page cannot point the server at a folder of its choosing. The board it opens gets its own port and its own key, as ifclara servehad started in its folder, so a page for one project holds no key for another. The marks are this user's own (0700, each file0600), and the server never writes them from a request. The hosted and static boards offer neither route. - Bugs. An error that is not one of Clara's refusals answers 500 with no details. The details go to the terminal running the server.
Tested by test/security/server.test.ts:
- A foreign
Host, including look-alikes such aslocalhost.evil.example, on every route. - Writes with no
Origin, a foreign one,nullor another local name, and withSec-Fetch-Sitesayingcross-siteorsame-site. Each leaves the board unchanged. - Each form content type, and a preflight, which gets no CORS header.
- A body over the limit that says so, one that lies about its length, and one sent in chunks over a real socket.
- No key, a wrong one, one a character too long, and the right key sent as a cookie, in the
query or as
Authorization. - On a real socket, the printed link keeps the key after
#, with nothing in its path or query.test/integration/cli-serve.test.tschecks that--openhands the browser a path without the key, to a file only this user can read, which is gone when the server stops. - The headers on every kind of response: page, script, 404, refusal, API answer, error and event stream.
- Seven spellings of a path that tries to climb out.
- Whether the machine's network address can connect.
test/integration/server.test.ts refuses a project folder the machine does not know, and
test/integration/cli-projects.test.ts opens one on a port of its own. test/integration/server.test.ts holds every REST operation to an answer with a code and a
hint, and shows that a bug's details stay out of the answer. test/integration/cli-serve.test.ts
runs the command on a real port, from the printed link to Ctrl-C.
Known limits.
- The printed link stays in the terminal's scrollback, and may stay in the browser's history though the page removes it from the address bar. Either opens nothing once the server stops, since each start makes a new key.
- A browser extension that may read every page can read the key, as it can read the page.
- A browser that cannot read the temporary folder, such as Firefox installed as a Snap, cannot
open the file
--openwrites. The printed link works in any browser. - An app that embeds Clara's server (C4.9) leaves out these local checks and brings its own;
createAppthen acts as whoever that app'scallersays. - Markdown in the page is sanitised by the web app. See Content.
Tokens
GitHub's, in the Action (M7). The Action's token reaches Clara as GITHUB_TOKEN, and Clara
takes it and the runner's other credentials out of its own environment at once, so nothing it
starts, git and the hooks git runs among them, inherits them. It gives the token to git and gh
only for the calls that reach GitHub, each in that call's environment: git as an
http.extraheader, gh as GH_TOKEN. It is never logged, never put in a URL, and taken out of
any error before it is shown.
work runs agents, which a ticket's text can talk into anything, and a process on the runner
can read every other one's environment. So it runs in two jobs (D-137):
- The agents' job has
contents: readand no token in any step that runs Clara. Clara refuses to run it with a token inGITHUB_TOKEN,GH_TOKENor their Enterprise forms, or with a checkout that kept one in git's configuration. It leaves the board's commit and each branch handed in as a git bundle and a manifest, uploaded as an artifact kept for a day. - The land job runs no agent and installs none, and holds
contents: writeandpull-requests: write. It reads the artifact as a stranger's: the manifest must parse and name nothing twice; the work must have begun at the commit it checked out; git checks every object it takes from the bundle; the board's commit must be one commit on that one, changing only plain files among the board's records (tickets, archive, sprints, releases, activity, views, playbooks, docs, the idea), neverconfig.json, an agent's profile,.gitignore,.gitattributesor anything outside.clara; each branch must be the one Clara names for its ticket, with a commit after the base. Nothing is pushed until all of it passes.
What the agents' job can still do: write records a person reads in the board's history, and push branches whose pull requests a person reviews, which is what it is for. Its artifact token lasts for the job.
The hosted board's (M8, D-138). HOSTED.md describes the board; here is what guards it.
- Nothing is stored on the server. A person's token lives in a cookie the server sealed with
AES-GCM under a key made from
CLARA_SECRET, with the cookie's name bound in, so it cannot be read, changed or passed off as another cookie. It isHttpOnly(the page's scripts never see it),SameSite=Lax, and over HTTPSSecurewith the__Host-prefix. It lasts eight hours. A cookie that was changed, expired, made for another name or under another secret is no cookie: the request is a stranger's. - Sign-in cannot be finished by someone else. The random
statesent to GitHub is held in a second sealed cookie for ten minutes and must come back with the code. A person whose token cannot read the board is told so and is not signed in. - Only the board's page changes the board. A
POSTto an operation, and sign-out, must carry the board's ownOrigin(and no cross-siteSec-Fetch-Site); anything else is refused withCROSS_SITEbefore the operation runs. The policy forbids forms (form-action 'none'), so sign-out is afetchfrom the page. - Permissions are GitHub's. Every read and write is a GitHub call made with the token of who
asked, so nobody can do on the board what they could not do in the repository, and every
commit carries their name. A public reader (
CLARA_PUBLIC_READ) reads through anonymous calls and every write is refused withNOT_SIGNED_IN. - Tokens are never logged or put in a URL. The token travels in the
Authorizationheader to GitHub and nowhere else. Errors shown to a person or written to the host's log are Clara's messages, never GitHub's request. The cache of who a token belongs to and of the branch's ETag is keyed by a SHA-256 fingerprint of the token, never the token. - MCP takes a token on every request.
/api/mcprefuses a request withoutAuthorization: Bearer, asks GitHub whose the token is, and keeps no session between requests. What the recommended fine-grained token can do is listed in HOSTED.md. - The hosted board runs no command and no agent. It has no route that starts one, and
nothing it bundles can: no module in it imports
node:child_processor a worker, and none of the command line's code is in it. - Missing settings say which, never their values.
What it does not guard against: the OAuth app asks for the repo scope, which GitHub gives
for every repository the person can reach, not only the board's. The server uses it for the
board's repository only, but anyone who can run code on the server (the deploy's owner, or
someone who compromised it) could use a signed-in person's token while their request is
handled. Deploy it where you trust whoever controls the deployment, as you would any OAuth
app you sign in to. A person's browser holds their token for eight hours; signing out on a
shared machine clears it.