●●●CrowdCode™›User guideversion 1.0.1We the People AI
Enclawed CrowdCode™ user guide · Safety and undo · version 1.0.1

Safety and undo

Enclawed™ decides every action

CrowdCode™ never runs anything on its own authority. Every action the model asks for, such as reading a file, writing one or running a command, goes to the Enclawed™ engine first. Enclawed™ answers in one of three ways:

  • allow: reading, edits that keep history, tests and builds that run contained;
  • ask you: for what can neither be undone nor checked;
  • refuse: reading your keys, sending data out, downloading and running code, and similar.

CrowdCode™ adds no security rules of its own. They are all Enclawed™'s, so one set of rules protects every tool that uses Enclawed™.

Everything goes through Enclawed™

Not only the model's actions. Everything that happens in a session reaches Enclawed™:

WhoWhatWhat Enclawed™ does
The modelevery action: reading, writing, searching, running commands and testsdecides it before it runs (allow, contain, ask you, or refuse)
Helper agentsstarting a helper, and every action of each helperdecides each one, knowing which helper asked; their changes are kept or rolled back with the task
Youa ?commanddecides it (a line you typed word for word counts as yours), records it whether it ran or not
Youa file you attach, paste or drop indecides it as a read before the model sees it (a private key, for example, is asked about)
Youspeaking (Ctrl+R)decides the recording as a read before a model hears it, and records it
Youevery line you enter: messages, / commands, ? commandsrecords it in its audit log (its kind and a digest, not the text)
Youyour answers to its questions, "always" answers, /approvals forget, reporting a question (r), choosing a microphonerecords each one
You/undo, ccode history restoreputs files back from its own history, and records it

Proving it's you at launch

When CrowdCode™ starts, before any model server starts, Enclawed™ checks that it's you:

  • with an Enclaweder™ connected: the code your Enclaweder™ checks (the device checks it, not this computer). If you also enrolled a security key or passkey, Enclawed™ asks for that first, then the code;
  • without one: your security key, or this computer's passkey (Windows Hello, Touch ID), through a page that opens in your browser.

If Enclawed™ doesn't accept it, CrowdCode™ closes. Each attempt is in Enclawed™'s audit log. When no factor is enrolled and no Enclaweder™ is connected, there is nothing to ask, and CrowdCode™ starts as before (ccode doctor says so). Enroll one with enclawed auth enroll (see below). A run with nobody there (ccode -p) needs Enclawed™'s unlock ticket instead: enclawed auth unlock, run by you beforehand.

Locking the screen

/lock (or Ctrl+X then L) locks the session at once, and it locks by itself after 15 minutes without a key. The terminal shows a moving screen of glyphs with the CrowdCode™ shield in the middle; your session is out of sight underneath.

  • Unlocking: press Enter and give Enclawed™'s second factor: a security key, a passkey, or your Enclaweder™'s code (a code you type is never shown). Enclawed™ checks it and records every attempt.
  • While it's locked, tasks keep running, and what they print waits; it all appears, in order, when you unlock. Keys go to the lock only: nobody can type into the session, answer Enclawed™'s questions, or stop a task with Ctrl+C or Ctrl+Z.
  • /lock after 5 changes the wait to 5 minutes; /lock after off stops the automatic lock. Locking later or never needs the second factor first.
  • The lock needs an enrolled factor (or a connected Enclaweder™): without one, nothing could open it, and CrowdCode™ says so instead of locking.

A second factor for your own actions

By default, what you do yourself runs as Enclawed™ decides, without more steps: a command you type is yours. If others could use your computer while you are away, or you want a deliberate pause before your own commands run, ask for Enclawed™'s second factor:

/factor on commands

From then on, each ?command waits, after Enclawed™ allows it and before it runs, for one of:

  • a security key (a FIDO2 key with a PIN, such as a YubiKey 5 or a Google Titan key);
  • this computer's passkey (Windows Hello with a TPM, Touch ID, or Android's secure hardware), through a page that opens in your browser;
  • the code your Enclaweder™ checks, when an Enclaweder™ device is connected (the device, not this computer, checks it).

Enclawed™ itself checks the factor and records every attempt in its audit log. Without the factor, nothing runs, and that is recorded too.

What you can protect:

/factor on …What then needs the second factor
commandsyour own ?commands
alwayssaving an "always" answer, and /approvals forget
undo/undo
allall three
  • /factor shows what is on, and which factors are enrolled. ccode doctor shows it too.
  • Turning protection on needs a factor enrolled first. Enroll one with Enclawed™:
    enclawed auth enroll --label primary              # a security key
    enclawed auth enroll --label backup               # a second key, kept somewhere safe
    enclawed auth enroll --passkey --label laptop     # this computer's passkey
  • Turning protection off (/factor off commands) needs the second factor itself, so nobody else can switch it off at your keyboard.
  • In ccode -p runs nobody is there to give the factor, so protected actions are refused.

Enclawed™'s audit log

Enclawed™ keeps an append-only log of what happened in your sessions, in ~/.local/state/crowdcode/audit.jsonl (yours only). Besides Enclawed™'s own records of every decision, CrowdCode™ adds:

RecordWhen
crowdcode.person.inputeach line you enter (its kind, a digest, the command's name)
crowdcode.person.shelleach ?command: the command, Enclawed™'s decision, whether it ran, its exit code, a digest of its output
crowdcode.person.voice, crowdcode.person.miceach recording (microphone, length, digests of the sound and the words), each microphone choice
crowdcode.person.reporteach question you reported to Enclawed™ with r
crowdcode.approval.always, crowdcode.approval.remembered, crowdcode.approval.forget"always" answers saved, used and removed
auth.second-factorevery second-factor attempt (Enclawed™'s own record)
crowdcode.factor.on, crowdcode.factor.offprotection turned on or off

Nothing is final until it's kept

  • Interrupted tasks (Ctrl+C) are rolled back.
  • Failed checks: with --verify-cmd, a task's changes are kept only if your check passes.
  • /undo puts back what the last task changed. A file you edited since is never overwritten; CrowdCode™ tells you about it instead.
  • Every earlier version of a file the agent changed is kept by Enclawed™:
ccode history                              # the kept versions
ccode history restore SHA256 --to PATH     # put one back

If CrowdCode™ dies

If CrowdCode™ is killed in the middle of a task (power loss, a crash, kill -9), the next start finds the unfinished task and rolls it back, again never touching a file you changed since. It also removes what the dead session left behind.

Run receipts

Every task ends with a signed run receipt. It records what the project looked like before and after, every action and Enclawed™'s decision on it, and the model used. Anyone can check one:

ccode receipt verify FILE

A receipt signed by this computer's own key is self-attested: it proves the record wasn't changed afterwards, not that the work is good. To check the work, re-run its verify command.

Your data

  • Your code, prompts and attachments go only to your own model servers.
  • Sessions are kept on your computer as fine-tuning candidates. A session holding a password or key is dropped, not kept. Nothing is trained on until you approve it (see Fine-tuning). --no-keep-session keeps nothing.
  • All of this lives in ~/.local/state/crowdcode, with access for you only.