Retrieved article excerpt
Open article · Retrieved 2026-11-06T15:22:14.142664+00:00
# Current
[Build Status](https://github.com/santosh79/current/actions/workflows/elixir.yml)
**Change control for AI agents**
Agents propose changes. Current validates them, waits for your approval, applies them, and records every step in a tamper-evident log.
[The Elevator Pitch](https://github.com/santosh79/current#the-elevator-pitch) · [See it in action](https://github.com/santosh79/current#see-it-in-action) ·
[Quickstart](https://github.com/santosh79/current#quickstart) · [How it works](https://github.com/santosh79/current#how-it-works) ·
[Provenance](https://github.com/santosh79/current#provenance-from-a-change-back-to-the-request) ·
[Reproducibility](https://github.com/santosh79/current#reproducibility-replay-the-record-anywhere) ·
[Verifiability](https://github.com/santosh79/current#verifiability-a-hash-chained-history) ·
[Architecture](https://github.com/santosh79/current#architecture) · [Intents](https://github.com/santosh79/current#intents) · [CLI](https://github.com/santosh79/current#cli-reference) ·
[HTTP API](https://github.com/santosh79/current#http-api) · [MCP](https://github.com/santosh79/current#mcp) · [Configuration](https://github.com/santosh79/current#configuration) ·
[Security](https://github.com/santosh79/current#security) · [Status](https://github.com/santosh79/current#what-exists-today) · [Roadmap](https://github.com/santosh79/current#roadmap)
---
## The Elevator Pitch
**Why not just use Claude Code or Codex?** You can. But there, the agent acts and you approve step by step as it goes. In Current, the agent can’t act at all. It hands over a complete proposal, and nothing happens until that proposal is approved and applied.
- **Safety**: The agent is limited to doing just one thing -- *producing proposals*. It sees only the files it asks for that Current's read policy permits, and can only propose changes from nine typed intents. Nothing touches your project until you approve it, and only allowlisted commands can run.
- **Verification**: You don’t take the agent’s word for it. You review the exact proposal, or have other agents review it, before anything happens, and Current checks the agent’s claims against what actually ran.
- **Provenance**: As agents write more of the code, someone will ask *why was this changed, and who approved it?* Current answers from a commit log: the oldest, best-tested idea in systems.
That log is hash-chained, so changes to past history are detectable, and the full state can be rebuilt from it on another machine.
> **Status: early.** Single node, local projects. Current is not a sandbox
> or an authentication system: approved commands run with the runtime's
> privileges. See [Security](https://github.com/santosh79/current#security) and the
> [threat model](https://github.com/santosh79/current/blob/main/docs/threat_model.md).
---
## See it in action
Ask Current to add CSRF protection to the included Next.js example:
```
current run "add CSRF protection to this app" \
--dir examples/nextjs-auth \
--model openai:gpt-5.6-sol
```
The model never gets the repository. It sees the layout and asks for what
it needs, and Current fetches each file:
```
… round 1: the model asked to see 8 things
✓ read_file app/api/login/route.ts 769 B
✓ read_file lib/auth.ts 626 B
✓ read_file lib/rate-limit.ts 2.4 KB
✓ read_file tests/login.test.ts 847 B
✓ read_file tests/rate-limit.test.ts 2.3 KB
✓ read_file package.json 343 B
✓ read_file tsconfig.json 221 B
✓ read_file .gitignore 83 B
```
Reads are confined to the project. Dependencies, build output, `.git` and
`.env*` files are never shown to the model, and every read is recorded.
Then it returns a proposal:
```
Agent produced proposal
proposal sha256:672c4973787b…
The login route already invokes a missing CSRF validator before parsing
credentials. Implement that validator with fail-closed same-origin Origin
checking and add focused coverage for accepted and rejected origins.
PROPOSED
1 WriteFile lib/csrf.ts
2 WriteFile tests/csrf.test.ts
3 RunCommand npm test
4 Report Add fail-closed same-origin CSRF validation for the login
route and unit tests covering valid, absent, malformed,
and cross-origin headers.
✓ Proposal decoded
✓ Proposal validated
Waiting for approval. Nothing has been applied.
```
**The agent has proposed a change. Your project is untouched.**
Review the exact files and commands, or pass the machine-readable version
(`--json`) to another agent for a second opinion:
```
current review sha256:672c4973787b
```
Then decide. Send it back with feedback, and the model reads more and
returns a new proposal:
```
current revise sha256:672c4973787b -m "add a test for a missing Origin header"
```
Or approve it. Approval is recorded, but nothing runs yet:
```
current approve sha256:672c4973787b -m "LGTM"
```
```
✓ Approved sha256:672c4973787b
message LGTM
Nothing has been applied. Apply it with:
current apply sha256:672c4973787b
```
Applying is its own step. Current, not the agent, writes the files and
runs the command:
```
current apply sha256:672c4973787b
```
```
✓ Proposal approved
✓ Workflow completed
MODE: APPLY
4 effects executed.
Inspect
current events sha256:1429719b7546
current proposal sha256:672c4973787b
current artifact sha256:fb30687f1722 (raw model output)
```
Every step above, from the request and each file the model read to its raw
reply, the approval and each effect's output, is now part of the workflow's
record. `current events` prints it.
---
## Quickstart
### Requirements
- Elixir 1.19 on Erlang/OTP (`mise.toml` pins OTP 28.5 and Elixir 1.19.5;
run `mise install` if you use [mise](https://mise.jdx.dev/))
- `git`, `make`, and `bash`
- An OpenAI or Anthropic API key
### 1. Get the code and build
```
git clone https://github.com/santosh79/current.git
cd current
mix deps.get
mix compile
make client
```
### 2. Start the runtime
In one terminal, export a key and start the server. It listens on
`127.0.0.1:4000` and prints every request and commit as it happens.
```
export ANTHROPIC_API_KEY="..." # or OPENAI_API_KEY
export CURRENT_ALLOWED_COMMANDS=npm # commands are denied unless allowlisted
bin/current-server
```
### 3. Make a request
In another terminal, from the repository root:
```
export PATH="$PWD:$PATH" # puts the local `current` CLI on PATH
current models # the models your keys give you
MODEL="openai:gpt-5.6" # replace with a model listed above
current run "add CSRF protection to this app" \
--dir examples/nextjs-auth \
--model $MODEL
```
`run` stops when the proposal is waiting for review. Output varies between
models and runs. Use `plan` instead of `run` for a proposal that can be
reviewed but never applied.
### 4. Review, decide, apply
```
current review <proposal-id>
current revise <proposal-id> -m "keep the route check, add edge cases"
current approve <proposal-id> -m "reviewed"
current apply <proposal-id>
```
Or `current reject <proposal-id> -m "..."` to end the workflow. A revision
produces a new proposal ID, which must be reviewed and approved in turn;
the earlier one is stale. IDs can be shortened to a unique prefix of at
least four hex characters.
### 5. Trace it
```
current events <workflow-id> # the full chain, in log order
current proposal <proposal-id> # intents, claims, and what the model read
current artifact <artifact-id> # exact bytes: a file, command output, a raw reply
```
---
## How it works
In a typical agent, a tool call *is* the action: the file is written the
moment the model decides to write it. In Current, the model's output is a
**proposal**, a list of typed intents:
> "in `lib/signup.ex`, replace this text with that"; "run `mix test`";
> "claim the tests pass, because that command exits 0"
A proposal does nothing on its own. Between it and your project, the
runtime:
1. **decodes** the model's reply, which is untrusted bytes, into a closed
set of intent types. Anything outside it is rejected, not interpreted;
2. **validates** it: paths confined to the project, files exist, every
edit matches exactly, claims cite earlier intents they can be checked
against;
3. **waits for a decision.** A proposal is reviewed as a unit and approved,
rejected, or sent back with feedback. The reviewer can be a person or
another agent: each decision is an API call, recorded as its own event
with the reviewer's metadata. A decision must name the workflow's latest
proposal, and revisions are bounded (10 by default);
4. **applies** it, in a separate step, with a small trusted interpreter
that re-checks every path immediately before touching it and records
every result;
5. **checks the outcome itself.** Claims are evaluated against recorded
results, and a claim that doesn't hold fails the workflow.
Every step is an event. Rounded boxes are where a workflow ends.
### Producing a proposal
1. A **task** is submitted with a prompt, a project directory and a model.
The directory is resolved once to its real path and recorded.
2. The model is given the project's **layout**: paths and sizes, no
contents. Dependencies, build output, VCS directories and `.env*` files
are left out.
3. The model may reply with an **observe** request: up to 20 `read_file`,
`glob` or `grep` intents, each with a reason. The runtime runs them
read-only, under path confinement and the read policy, and asks again
with the results. Up to 8 rounds, 400 KB of results in total, 200 KB
per file.
4. The model replies with a **proposal**. Its exact reply is stored as an
artifact, whatever it contains.
5. The proposal is **decoded** into typed intents
([wire contract](https://github.com/santosh79/current/blob/main/docs/wire_schema.md)), every path is made absolute
against the project, and it is **validated**.
Validation answers "is this well-formed and in bounds right now?", not
"will it apply cleanly?". The project can change before apply, and those
failures are caught and recorded then. Producing a proposal is bounded by
`llm_proposal_timeout_ms` per call and the task's `--timeout-minutes`
(default 10) overall.
### Applying it
`apply` starts the interpreter. It re-checks every path against the
filesystem as it is *now* (following symlinks), then carries out the
intents in order. The first failure, or the first claim that doesn't
hold, stops it and fails the workflow. Effects are not rolled back. The
re-check narrows the window for a path to escape the project but doesn't
close it (T2 in the [threat model](https://github.com/santosh79/current/blob/main/docs/threat_model.md)).
### Lifecycle
```
created → planning → validating → waiting_for_approval
plan mode: → planned
apply mode: → approved → applying → assembling_result → completed
→ rejected
→ revision_requested → planning → validating → waiting_for_approval
(bounded; each pass adds a proposal to the workflow)
any stage: → failed (production, validation or an effect failed)
→ abandoned (no further automatic progress is possible)
planning: the model sees the layout, may ask to read files, then returns a proposal
```
### Three primitives
| Primitive | When | Role | More |
| --- | --- | --- | --- |
| Intent | Before execution | A proposal, as data | [intent.md](https://github.com/santosh79/current/blob/main/docs/intent.md) |
| Event | After execution or decision | A fact | [event.md](https://github.com/santosh79/current/blob/main/docs/event.md) |
| Artifact | Throughout | Immutable bytes, named by their SHA-256 | [artifact.md](https://github.com/santosh79/current/blob/main/docs/artifact.md) |
> *Intents propose change. Artifacts hold bytes. Events record fact.
> State is derived from