DEV Community

C1
C1

Posted on

I let OpenCode write 500 lines. Here's what Selo caught

Selo

I use OpenCode on real projects every day. After a few months of that, I noticed a pattern.

The agent finishes. It says "all done, tests pass." I glance at the diff, it looks roughly right, and I merge. Three days later I find it quietly edited .env, or deleted an assertion that was inconvenient, or wrote "no breaking changes" in the commit message while breaking three things.

The agent wasn't lying exactly. It was optimizing for sounding done.

The problem isn't that Claude Code is bad — it's genuinely useful. The problem is that "the agent said it's done" is not evidence. It's the agent's self-report. I wanted something different: a record of what the agent actually touched, signed so that a third party can check it without trusting me.

That's what I built. It's called [Selo].

What Selo does?

Every time you run Selo, your coding agent runs in a throwaway Git worktree. Your actual checkout is never touched. After the agent finishes, Selo audits the real diff — not the agent's summary of it — against rules you configure:

  • Forbidden file edits (.env, key files, anything you name)
  • Scope violations (files outside your permission_allowlist globs)
  • Secret scan (with leetspeak and zero-width character folding)
  • Forbidden claims (agent wrote "tests pass" or "no errors" when they don't)
  • Test tampering (deleted, skipped, or weakened assertions)
  • Required commands (go test ./... exits non-zero → run is rejected)
  • Patch and round limits

Every outcome — pass or fail — gets an Ed25519-signed receipt. Anyone can verify it:

selo verify receipt.json --pubkey <fingerprint>
Enter fullscreen mode Exit fullscreen mode

That includes your teammate, your CI pipeline, or your client's tech lead. They don't need to trust you. They run one command.

A real receipt

Here's what a catch looks like. This is actual verifier output from a rehearsal run against a deliberate offender:

Receipt:    c1f-1795016097433669000
Verdict:    FAILED_SAFETY
Checks:     checks_version 1 — required-commands gate semantics (0.7.0+)
Hash:       OK
Signature:  OK
Provenance: PINNED
Result:     VALID
Enter fullscreen mode Exit fullscreen mode

The findings: the offender edited .env (a forbidden path) and wrote SECURE_BY_DESIGN and BATTLE_TESTED in a summary file (forbidden claims). The worktree was rejected. The receipt is tamper-evident — flipping one byte makes verification fail.

The signing key fingerprint is e9512c4fc525598a7d8187cef80455d33a7dc9600920a9adaf9396ab0579cbaf. That string is the commitment. If a reviewer has it, they can prove the receipt wasn't modified after the fact.

Try it yourself in 10 seconds

No repo. No account. No API key.

# Install — verifies SHA-256 + cosign signature, fails closed
curl -fsSL https://raw.githubusercontent.com/C1-run/Selo/main/install.sh | bash

# Prove all safety controls fire
selo selftest
Enter fullscreen mode Exit fullscreen mode

selftest plants a secret, a .env edit, a forbidden claim, and a deleted test — then runs all four through the pipeline. You get four FAILED_SAFETY receipts and four clean selo verify results. That's Selo's guarantee about itself.

Wire it into OpenCode (or any MCP client)

Add to ~/.config/opencode/opencode.json:

{
  "mcpServers": {
    "selo": { "command": "/usr/local/bin/selo", "args": ["mcp", "serve"] }
  }
}
Enter fullscreen mode Exit fullscreen mode

For Claude Code: claude mcp add selo -- selo mcp serve. Works with Cursor, Kiro, and anything else that speaks stdio MCP.

Once connected, opencode mcp list shows selo [x] connected. The three tools — selo_preflight, selo_check_diff, selo_scan_path — are now callable from inside any agent session.

One thing to know about selo_scan_path:** don't point it at a large repo root. The tool scans every file and dumps all hits into one JSON-RPC response — on a repo with hundreds of files that's >16 MiB of stdout, which crashes the MCP stdio transport. Use it on small dirs (config files, a single package). For a whole repo, use selo_check_diff on the actual diff instead — it only scans changed files and never overflows the transport. I hit this live on the prism repo and fixed it with a 500-file guard: the tool now refuses with a clear message and directs you to selo_check_diff.

The honest limits

This is in the README's "Why not Selo" section, and I'm repeating it here because trust tools live and die on not overselling.

Post-run audit, not prevention.** The violating change is contained in the worktree and rejected before merge — but it did happen. Selo documents and rejects it; it doesn't intercept the agent mid-run.

Worktree containment, not a Docker sandbox.** If you need container isolation, pair Selo with one.

Heuristic checks, not SAST. It governs agent behavior — scope violations, test tampering, secret smuggling, forbidden claims. It won't find SQL injection or CVEs.

Operator-signed by default, not non-repudiable. Under the default ~/.selo/signing-key, the honest ceiling is "tamper-evident evidence of what Selo observed." For stronger provenance you need an external signer (--require-keysource=command), RFC3161 timestamps (--tsa), and a Rekor log entry (--rekor). The README explains all three.

Why this matters for shipping AI-assisted code to clients?

The gap I kept running into: a client's tech lead looks at the PR and asks "which parts did the AI write, and did it stay in scope?" There's no good answer to that today. Human code review catches what the reviewer catches. The agent's own summary is optimistic by design.

A Selo receipt changes the question. Instead of "do you trust that the agent behaved?" it becomes "here's a signed record of what it touched — verify it yourself." The client's reviewer runs selo verify and gets Provenance: PINNED, Result: VALID in their own terminal.

That's not a sales pitch. It's the actual thing the tool does, with the actual caveats. Receipt cards also post into GitHub job summaries and PR comments if you want them in the review workflow automatically.

What's next

Selo is v0.7.2, Apache-2.0, one maintainer. The near-term focus is tighter checks and independent receiver co-signing — the piece that moves a receipt from "tamper-evident" to non-repudiable. Config may shift before 1.0. The changelog tracks what's shipped.

Two fixes landed during this integration test and are already on main:

The two things I'm most interested in feedback on: the receipt format/trust model, and what rules you'd actually configure if you tried it on a real repo. If you've thought about what "agent-authored code" means for handoff and accountability, I'd genuinely like to hear it.

Repo: github.com/C1-run/Selo
Landing: selo.c1.run

Content note: all receipt output in this post is from a real signed rehearsal run, not fabricated. The offender is a deterministic shell script, not an LLM agent — that's stated in the receipt itself (c1_runtime_is_mock: true). The binary sha256 and signing fingerprint in this post match the verification log at github.com/C1-run/Selo/tree/main/pilot/rehearsal.

Top comments (0)