Jarvis Deck
Jarvis · a personal development agent

From a task in chat to a verified PR. No API key.

Imagine we need an agent that takes a task from chat to a verified PR by itself. Here are the 10 problems on the way, the options for each, and what we chose in Jarvis.

InputA task in chat (web chat, Slack next)
Engineclaude -p on a subscription
Where it runsA laptop or a VPS in a tailnet
OutputA draft PR; a human merges
Project docs →
Agenda

Requirements, 10 problems and their options, then a demo and the course

Task · requirements

Imagine we're building a development agent with these requirements

R1

Runs on its own on my subscription, no API key

R2

Takes a task from chat to a draft PR with green checks

R3

Gathers context from Notion, Google Docs and the repo

R4

Never merges, never pushes to main, never does anything irreversible

R5

Never sees or leaks secrets

R6

Works with the laptop closed and is reachable from a phone

R7

Doesn't obey orders from other people's comments and logs

R8

Learns from its own tasks and doesn't burn through its limits

Task · what the result looks like

A human sets the task, approves the spec and merges. The agent does the rest

Human

Writes the task in chatwhat to do and in which repository

Jarvis

Gathers context, writes the spec and plancontext.md, spec.md, plan.md, tasks.md

Human

Reads the spec and clicks Approveor answers a single, specific question

Jarvis

Writes code in a separate worktree, goes through reviewbranch jarvis/T-n, a separate reviewer agent

Engine

Runs checks, pushes, opens a draft PRrefuses on red unless main fails the same way; only the engine holds the GitHub token

Jarvis

Fixes red CI and review commentswakes up only when something changes in the PR

Human

Final review and mergethe agent never merges

Real run · task T-3 · 08.11.2026
6

worker runs from chat to draft PR

≈ $4.09

the CLI's estimate. On the Max plan this isn't a bill, just a counter for the budget brake.

0

permission cards: the agent never stopped to wait for a human to approve a command.

Task · what it's built from

10 tools Jarvis is built on, and what each one does

ToolWhat it isWhat it does in Jarvis
Claude Code CLIAnthropic's official terminal agentThe only way to call the model: claude -p on a subscription
MCPThe protocol for giving models toolsThe model changes state through it: create_task, open_pr
Postgres + DrizzleA database and typed access to itTasks, runs, journal and spend; after a restart the engine picks up where it left off
Fastify, Zod, ReactHTTP server, data schemas, UIAn API with an event stream (SSE) and an admin panel; shared contracts
GitHubCode, PRs and CIA bot account: clone, push, draft PR; the watcher polls CI
Notion and Google Docs MCPConnectors to knowledge sourcesThe worker reads requirements and rules but never sees the tokens
Playwright MCP + DockerBrowser control and containersUI checks in a throwaway container, screenshots in the PR
InfisicalA secrets storeThe single owner of all tokens; details on the next slide
Tailscale + HetznerA private network and a VPSA server with no open ports, UI only from the owner's devices
Grafana + healthchecks.ioMetrics, logs and an “I'm alive” pingA missing ping means the engine isn't responding
Tool · secrets

Infisical: one store that gives the laptop and the server the same secrets

What it is

An open-source secrets store

A web UI and a CLI: secrets are stored encrypted, with change history and access rights. We use the cloud version, but you can also self-host it.

4 concepts
  • Project: we have one, jarvis
  • Environment: dev for the laptop, prod for the server
  • Secret: a name–value pair, same names as in .env.example
  • Machine identity: a non-human account for the server
How we use it
  • Laptop: infisical login with your own account
  • Server: a machine identity, read-only on prod
  • Launch: with-secrets.sh logs in and calls infisical run: values go into the process environment, never to disk
What we gained
  • One source for the laptop, the rehearsal container and the server
  • Rotation: change the value and restart jarvis-engine
  • compose.yaml and systemd hold no values at all, only variable names
What it cost
  • Without Infisical the engine won't start (processes already running are unaffected)
  • One more external account
  • The only secret on the server's disk: the machine identity's client secret, /etc/jarvis/infisical.env, root, 0600
Task · problem map

10 problems we'll run into. The model alone solves none of them

P01 · running

How to run on a subscription without the API?

layer: CLI
P02 · state

How to survive restarts and sleep?

layer: engine
P03 · context

How to give context without flooding the window?

layer: plugin · MCP
P04 · trust

How to keep red code out of the PR?

layer: engine
P05 · action limits

How to allow Bash but nothing irreversible?

layer: plugin · MCP
P06 · secrets

How to keep tokens away from the model?

layer: environment
P07 · access

How to reach the agent from anywhere?

layer: environment
P08 · untrusted text

How to tell data from orders?

layer: engine · prompt
P09 · memory

How to learn between runs?

layer: engine · plugin
P10 · cost

How to see spend and stop a loop?

layer: CLI · engine

Each tile leads to its problem. The layer shows where in the harness the solution lives.

Task · all on one slide

10 problems: what we chose, what we rejected and why

P01 · runningclaude -p with stream-json
P02 · statePostgres and a state machine in the engine
P03 · contextSubagent, MCP, docs as a map
P04 · trustopen_pr: the engine checks
P05 · action limitsDeny-list, tools per role
P06 · secretsInfisical, env allow-list
P07 · accessVPS and tailnet
P08 · untrusted text<untrusted-content> and a report
P09 · memoryA single file the agent maintains
P10 · costConfig, CLI flags, console

Hover over a problem to see the breakdown: what's wrong, what we chose, what we rejected, the cost, and where it lives in the repo.

Problem P01

The agent has to work without a human, but the API bills every token, and a subscription is meant for a human in the CLI.

What we chose. claude -p with stream-json: the official CLI on a subscription, every event arrives as JSON, limits are set with flags.

What we rejected and why

  • Agent SDK with an API key: a separate bill, the subscription doesn't apply. Anthropic doesn't allow the SDK under a claude.ai login (ADR-0003)
  • Interactive session and channels: research preview, workers in tmux, no structured log (ADR-0003)

The cost

A run's cost is only visible at its end.

Where to look

ADR-0003 · engine/src/infrastructure/claude/

Problem P02

A model session doesn't survive a restart, and context compaction quietly drops what the agent “remembered”.

What we chose. Postgres and a state machine in the engine: after a restart the engine reads the database and carries on. The model changes state only through MCP tools.

What we rejected and why

  • State in the model session: restarts and compaction lose it
  • state.json and files: the journal and run events are tables (ADR-0008)
  • SQLite: the owner wanted Postgres in Docker (ADR-0008)

The cost

Development needs Docker.

Where to look

ADR-0008 · engine/src/domain/task.ts

Problem P03

What the agent hasn't read doesn't exist for it. And a long search uses up the context window before any code gets written.

What we chose. The context-researcher subagent reads sources via MCP separately, so the worker's window stays clean. Every requirement links to its source.

What we rejected and why

  • Pasting context by hand: the human becomes the bottleneck
  • A RAG index over all docs: the index has to be kept fresh, so we skipped it

The cost

Quality depends on how well the docs are written.

Where to look

agent/agents/context-researcher.md · docs/architecture/connectors.md

Problem P04

Before ADR-0022 the engine trusted report_checks(passed: true), and a PR got opened even when checks were red.

What we chose. open_pr: the engine runs the checks and refuses on red. The reviewer and ui-tester come on top. Nothing can bypass it: the worker has no GitHub token.

What we rejected and why

  • A rule in the prompt: a promise, not a guarantee
  • Pre-push hook: lives in the repo the worker can change
  • GitHub required checks only: don't stop a red push (all ADR-0022)

The cost

Check commands are fixed up front, when the spec is approved.

Where to look

ADR-0022 · docs/plans/engine-side-checks-and-pr.md

Problem P05

Merge, push to main, rm -rf, sudo: one such action costs more than all the hours saved.

What we chose. A deny-list and tools per role: Bash is allowed, irreversible actions aren't, anything doubtful goes to the owner as a card. Since 11.11, UI checks also run in a throwaway container.

What we rejected and why

  • Narrow Bash(cmd:*) permissions: a single && raised a card and the run hung. Removed after T-3
  • A blacklist of strings: easy to bypass, yet people trust it (ADR-0022)

The cost

The list needs upkeep. So far the container covers only UI checks.

Where to look

agent/settings/worker.json · ADR-0026

Problem P06

A secret that lands in the model's context, a log or a chat is considered compromised.

What we chose. Infisical and an env allow-list: one source of secrets, a worker with no token, the child claude sees only allowed variables.

What we rejected and why

  • A hand-edited .env: went stale, which led to “Bad credentials” (ADR-0015)
  • A token in a URL or config: ended up in .git/config, fixed on 08.11

The cost

Without Infisical the engine won't start. A separate uid for child processes isn't done yet.

Where to look

ADR-0015 · scripts/with-secrets.sh

Problem P07

A task takes 20–40 minutes. Close the laptop lid and the work stops. You can't approve a spec from your phone either.

What we chose. A Hetzner VPS and a private Tailscale network: access from all your devices, 0 inbound ports.

What we rejected and why

  • Keep it on the laptop: sleep stops the task
  • A VPS with a public address: the UI and subscription login are exposed to the internet
  • GitHub App and a webhook via a tunnel: needs a public address or a tunnel (ADR-0007)

The cost

No webhook, so the watcher polls GitHub. The first live task on the server hasn't run yet.

Where to look

ADR-0016 · docs/architecture/deployment.md

Problem P08

Prompt injection: an order in a review comment or a CI log looks just like an instruction from the engine.

What we chose. The engine wraps untrusted text in <untrusted-content>. The prompts say not to follow the order but to report the attempt to the owner.

What we rejected and why

  • Only a rule in the prompt: not enough for text we assemble ourselves (ADR-0017)
  • An order filter: no filter detects them reliably, and it mangles comments (ADR-0017)
  • Dual LLM / CaMeL: more complex and more runs, so we skipped it

The cost

Text the model fetches by itself can't be wrapped by the engine.

Where to look

ADR-0017 · engine/src/application/conversation/untrusted.ts

Problem P09

What the agent figured out during a task is lost when the run ends. The next task repeats the same mistakes.

What we chose. One USER.md file with a ## Learned section. Each entry has a date and counts of confirmations and refutations. Nothing disappears by itself.

What we rejected and why

  • An approval card per entry: the owner becomes the bottleneck
  • A raw log and a distiller run: costs an extra run and has to guess at duplicates
  • Split across 3 files: 3 write paths (all ADR-0021)

The cost

Not tried on a live task yet, only in tests.

Where to look

ADR-0021 · docs/plans/agent-memory.md

Problem P10

On a subscription no bill arrives to raise the alarm. A runaway loop quietly eats the limits.

What we chose. Limits in the config and CLI flags: --max-turns, --max-budget-usd, a daily token limit. Every event is visible in the console, metrics go to Grafana.

What we rejected and why

  • No limits: the first runaway loop eats the day
  • Limits in env or in the DB via UI: easy to change, one more dependency (ADR-0005)

The cost

Cost is only visible at the end of a run. The CLI gives no per-subagent breakdown.

Where to look

ADR-0005 · ~/.jarvis/jarvis.config.json · Usage page

Harness · layers

An agent is a model plus a harness. Everyone has the same model; the harness is what differs

06 · ENVIRONMENT 05 · ENGINE 04 · MCP TOOLS 03 · AGENT DEFINITION 02 · CLAUDE CODE · AGENT LOOP Model01 · Opus · Sonnet
FIG. 4.1 · the harness around the modelclick → files

Claude Code is itself a harness. Layers 01–02 come from Anthropic, 03–06 are ours. Click a layer to see its files in the repo.

01
ModelOpus for the dispatcher and worker, Sonnet for the reviewer and ui-tester. A task can use a different model→ thinks and writes
02
Claude Code: already a harnessTool loop, subagents, skills, hooks, permissions, context compaction→ we don't write our own loop, we wrap this one
03
Agent definitionThe agent/ plugin: SOUL, roles, subagents, skills, settings with a deny-list→ behavior as files in git
04
ToolsThe Jarvis MCP server: create_task, ask_owner, open_pr, approve→ the limit of what a role can do
05
EngineState machine, slots, limits, checks, push and PR, watcher→ guarantees outside the model
06
EnvironmentA worktree per task, allow-listed variables, throwaway containers for UI checks, systemd, tailnet→ isolation and availability
Harness · agent definition

The agent is 11 files you can open and edit

All of this lives in the agent/ folder and loads into every run as a Claude Code plugin. The owner's preferences live separately, in ~/.jarvis/USER.md, and are never committed to git.

Problem 01 · running the model

How do you run the model so the agent works on its own without an API bill?

The agent must work without a human, but the API bills per token, and the subscription is meant for a person using the CLI.

A

Agent SDK with an API key

  • full control over the loop
  • separate bill; the subscription doesn't cover it
rejected · ADR-0003
B

Interactive session + channels

  • live session, workers in tmux
  • research preview
  • no structured log
rejected · ADR-0003
C

claude -p with stream-json

  • subscription, official CLI
  • every event as JSON
  • limits via flags
  • cost is known only after the run
✓ our choice
Poll

An ANTHROPIC_API_KEY is accidentally set in the environment. What does claude -p do?

Type a number in the chat
1Ignores the key and uses the subscription
2Silently uses the API and bills youCorrect
3Asks which one to use
4Fails with an error
Problem 01 · how we did it

Jarvis runs only the official CLI, so usage stays on the subscription

jarvis-engine → claude · worker run
$ claude -p --output-format stream-json --verbose \
    --max-turns 120 --max-budget-usd 10 \
    --permission-prompt-tool mcp__jarvis__approve \
    --plugin-dir agent/ --setting-sources project,local
# each event is a JSON line; the engine stores and shows it
{"type":"system","subtype":"init","session_id":"…"}
{"type":"assistant",…"tool_use","name":"Read",…}
{"type":"user",…"tool_result",…}
{"type":"result","num_turns":…,"total_cost_usd":…}
stream-json event format · values omitted
Safeguard

The engine won't start with an API key

If it sees ANTHROPIC_API_KEY or ANTHROPIC_AUTH_TOKEN, it refuses to run. It also strips these variables from the environment of child processes.

1 subscription, 1 person. You log in once with the claude command.

Brake

The budget is a counter, not a bill

  • 120 turns and $10 per run
  • 50M tokens per day, 120 min per task
  • 1 slot on a laptop, 3 on a server
  • 3 check attempts, 2 CI rounds, 3 reviews

The daily limit is in tokens: the CLI's dollar figure is an estimate for the whole session, not for a single run.

Problem 02 · state and long tasks

A task runs for an hour. How do you keep it alive when the process crashes, the laptop sleeps or the context gets compacted?

A model session doesn't survive a restart, and compaction quietly drops what the agent “remembered”.

A

State in the model session

  • nothing to build
  • restarts and compaction lose it
general approach
B

state.json and files

  • no database
  • the journal and run events fit tables better
rejected · ADR-0008
C

SQLite

  • a single file
  • the owner wanted Postgres in Docker
rejected · ADR-0008
D

Postgres + a state machine in the engine

  • a restart resumes from the database
  • the model writes state only via MCP
  • needs Docker
✓ our choice
Problem 02 · processes

The engine holds the state; Claude only thinks

Ownerweb chat · Approve GitHubPR · CI · review poll · push · PR messages, decisions JARVIS-ENGINE · NODE + FASTIFY · NO MODEL · THE ONLY STATE WRITER HTTP API + SSEweb app,live events State machinePostgres: tasks,journal, runs Schedulerslots, budget,limits Jarvis MCP servertoolsper role Watchertimer, no model,wakes on change spawn claude -p claude -p · dispatcherper message, --resume the threadcreate_task · send_to_task · reply claude -p · worker1 task · its own worktree jarvis/T-nresearcher · verifier · implementer · reviewer · ui-tester MCP stdio
FIG. 3.1 · processes and who launches whomhumanmodel and stateengine codeexternal

The main rule: the model changes state only through the engine's tools (the Jarvis MCP server). It never writes to the database or config directly.

Problem 02 · state machine

A task is a state machine: 12 stages, fix loops and 3 exits

Intaketask Contextcontext.md Spec ReviewApprove Implementingcode Verifyingchecks Reviewingreview · UI PR Opendraft PR FixingCI, comments Donehuman merge CI green + approval spec edits red review blocker new commit from any working stage Blockedanswer → back to the same stage Failedexit only via owner_retry Cancelledfinal ◆ human Retrospec only≥ 5 RUNS
FIG. 3.2 · transitions from engine/src/domain/task.tshuman decisionagent workexitsuccessspec only
Problem 03 · context and documentation

Requirements in Notion, decisions in Docs, rules in the repo. How do you give the agent what it needs without filling its context?

If the agent hasn't read something, it doesn't exist for it. And a long search fills the window before the first line of code.

A

Paste context by hand

  • full control
  • the human becomes the bottleneck
general approach
B

RAG index over all documents

  • fast search
  • the index has to stay up to date
not tried
C

Subagent + MCP + docs as a map

  • the worker's window stays clean
  • every requirement has a source
  • quality depends on the docs
✓ our choice
Problem 03 · documentation

A single entry point, everything else a link away: humans and agents read the docs the same way

jarvis/this repository
jarvis/
├── AGENTS.md         # entry: rules, modules
├── STATUS.md         # what's done, what's next
├── docs/
│   ├── specs/        # what and why, criteria
│   ├── architecture/ # how it's built
│   └── decisions/architecture/
│                     # 26 ADRs · scope · RULE/CHECK
├── .claude/agents/   # implementer, spec-creator
├── .claude/skills/   # onion, fastify, drizzle…
├── agent/            # plugin: SOUL, roles, skills
└── engine/ web/ shared/
dev-digest/course project
dev-digest/
├── CLAUDE.md          # short map
├── server/CLAUDE.md   # module rules
├── client/CLAUDE.md
├── reviewer-core/CLAUDE.md
├── specs/NN-slug.md   # feature = file
├── plans/             # plan from planner
├── docs/retro/ledger/ # run retros
├── evals/             # skills · agents
└── .claude/
    ├── agents/        # 8 pipeline roles
    └── skills/        # workflow-retro…

Same idea in both: a short file at the entry, details next to the code, decisions kept apart from specs. The agent always reads the orange files and opens the rest when needed.

Problem 03 · reading path

What the agent reads, in order. The rest of the docs never enters the context window

READING PATH AGENTS.md · alwaysrules and a module table with commands→ commands are frozen on Approve STATUS.md · at startwhat's done and what's next→ no session starts from scratch task spec.mdacceptance criteria→ verifier and reviewer check against it ADRs whose scope the task touchesdecisions and RULE/CHECK pairs→ new dependency only via an ADR module CLAUDE.mdrules for this module only→ other modules aren't loaded task codeonly files the diff touches→ diff stays within the task CONTEXT WINDOW · SCHEMATIC AGENTS STATUS spec ADR CLAUDE.md code OUTSIDE THE WINDOW docs/architecture/*other modulesADRs for other partsold specs not read by the agentdoesn't exist to it
FIG. 10.1 · progressive disclosurealways readwhen neededcode
Problem 04 · trusting the result

The model says “tests are green”. How do we make sure red code physically can't reach a PR?

Before ADR-0022 the engine trusted report_checks(passed: true), and the PR opened even after a red run.

A

A rule in the prompt

  • cheap
  • a promise, not a guarantee
rejected · ADR-0022
B

Pre-push hook

  • standard git
  • lives in a repo the worker can change
rejected · ADR-0022
C

Only GitHub required checks

  • CI already exists
  • won't stop a red push
rejected · ADR-0022
D

open_pr: the engine checks

  • no way around it
  • plus reviewer and ui-tester
  • commands are fixed up front
✓ our choice
Problem 04 · sequence

open_pr: red code never reaches GitHub

Workerclaude -p MCP Jarvisstdio Engineengine Checksin the task worktree GitHubbot account open_pr(title, body) engine HTTP API commands frozen on Approve alt [red] ✕ exit ≠ 0 → rerun on main rejected if main is green · fix and retry (≤ 3) [green] ✓ green, or red on main too push jarvis/T-n (this exact commit) + draft PR PR #n · the worker process exits
FIG. 4.2 · sequence · ADR-0022worker: no git push, no gh, no token

The worker has no way around this sequence: it has neither a token nor a tool that pushes. Since 11.11: anything also red on main isn't the task's fault and goes into the PR under “Fails on main too”. The worker can skip a red command only with a reason, and then CI decides.

Problem 04 · prompt or code

Anything that must happen moved from the prompt into the harness

RequirementBefore: a rule in the promptNow: code in the harness
Checks before a PR“Don't report passed without running” in worker.mdThe engine runs the commands and rejects on red (ADR-0022)
Progress in chat“Say what you're doing.” It didn't, and the chat looked deadThe engine posts updates itself: after 30 seconds, then every minute
Untrusted text is dataPrinciple 4 in SOUL.mdThe engine wraps the text in <untrusted-content> (ADR-0017)
Never push to mainA ban in the prompt and GH_TOKEN in the environmentThe worker has neither a token nor a push tool
Don't burn the budgetNothing--max-turns and --max-budget-usd in the CLI, a daily token limit in the engine
Check the UI before a PR“Walk through the UI in a browser” in worker.mdopen_pr refuses until a UI check was attempted (ADR-0026)

The rule from the first live run: the prompt handles style and judgment; code handles everything that must always happen.

Problem 05 · action limits

Without Bash the agent can't build the project. With Bash it can do anything. How do we stop it doing something irreversible?

Merge, push to main, rm -rf, sudo: one of these costs more than all the hours saved.

A

Narrow permissions Bash(cmd:*)

  • exact list
  • a single && raised a card and the run hung
removed after T-3
B

String blacklist

  • simple
  • easy to bypass, yet trusted
rejected · ADR-0022
C

Deny-list + tools per role

  • Bash allowed, irreversible actions not
  • anything questionable becomes a card
  • the list needs upkeep
✓ our choice
D

Disposable container

  • real isolation
  • read-only copy of the worktree
  • only for the UI check so far
✓ since 11.11 · ADR-0026
Problem 05 · 6 safeguards

The agent works on its own, within 6 rules

Permissions

A deny-list instead of an allow-list

Bash is allowed; git push, gh, rm -rf, sudo, git reset --hard are banned. Anything else questionable goes to the owner as a card.

Untrusted text

A PR comment is data, not an order

The engine wraps external text in an <untrusted-content> tag. If the agent sees an instruction inside, it stops and asks the owner.

Repositories

Clones only from an allow-list

An explicit list of owner/name, or “any repository in my account”. Jarvis's own repository is a target only with the repos.allowSelf flag, which is off and can't be turned on from chat.

Checks

The engine runs the tests, not the model

Commands are frozen when the spec is approved. On red the PR won't open, unless main is red the same way. The exact commit that was checked is the one pushed.

Limits

Every loop has a limit

Turns, budget per run, tokens per day, time per task, fix rounds, 100 commits and 100 PR comments a day. At the limit the task stops with an explanation.

Human

A human always does the merge

The agent has no tool that merges, pushes to the base branch or deletes a branch. The PR is always a draft.

Problem 06 · secrets

The agent needs tokens. How do we keep the model from seeing them?

A secret that lands in the model's context, a log or a chat counts as compromised.

A

A hand-edited .env

  • familiar
  • drifted out of sync: “Bad credentials”
rejected · ADR-0015
B

Token in a URL or config

  • works right away
  • ends up in .git/config
fixed 08.11
C

Infisical + env allowlist

  • a single source
  • worker has no token
  • engine won't start without Infisical
✓ our choice
Problem 06 · inventory

Each credential has a single owner, and the worker has no GitHub token at all

CredentialWhat it isWho uses itDoes the model see it
Claude subscriptionThe claude login, stored in ~/.claudeThe CLI itselfno, it's not an env variable
GITHUB_TOKENBot account's fine-grained PAT, only for allowed reposEngine: clone, push, draft PR, watcherno, the worker doesn't have it
NOTION_TOKEN, Google OAuthReading Notion and Google DocsConnector MCP serverssees only the result
POSTGRES_PASSWORD, DATABASE_URLGenerated database password, not the defaultEngineno
HEARTBEAT_URL, OTLP headers“I'm alive” ping and metrics to GrafanaEngine and the Alloy agentno
Slack tokensBot in Socket Mode, no public addressAdapter in the engineiteration 2

Known limitation: the child claude runs as the same user as the engine and could, in theory, read its environment via /proc. On a single-owner machine we accept this. The proper fix is a separate uid for child processes.

Problem 06 · path of a secret

Secrets live in a single place, and each process gets only the ones it needs

Infisicaljarvis projectdev · prod with-secrets.shlogin → secrets into envno Infisical: plain start engine process.envread only by infrastructure/config DATABASE_URLGITHUB_TOKENNOTION_TOKENHEARTBEAT_URLOTLP headersPATH · HOME · LANG · USER … ALLOWLIST ✕ ✕ ✕ ✕ ✕ child claude envchild-env.ts · INHERITED ✓ PATH · HOME · LANG✓ USER · SHELL · TMPDIR✓ CLAUDE_CONFIG_DIR✓ GIT_AUTHOR_* · _COMMITTER_*✓ PLAYWRIGHT_BROWSERS_PATH✕ everything else is dropped
FIG. 6.1 · path of a secret · ADR-0015passesdropped
Laptop

infisical login with your own account

Fallback: ~/.jarvis/.env. It's an export from Infisical, not a second source.

Server

Machine identity, read-only on prod

The only secret on disk: /etc/jarvis/infisical.env, root, 0600. Rotation: change it in Infisical and restart.

Problem 06 · our mistakes

These rules came from 5 of our own mistakes

1Secrets live only in Infisical. .env is an export, not a second source.
2Committed files hold variable names only. Compose won't start without a value.
3No tokens in URLs or config. A credential helper reads the token on each use.
4The worker has no GitHub token. The engine pushes and opens PRs.
5On the server only root reads the secret. The agent user isn't in the docker group.
6A child process gets its environment from an allowlist.
7A secret that passed through a chat or log gets rotated.

How to read this

Left: 7 rules. Right: 5 real cases from this project, November 2026. Click a case to highlight the rules it led to.

None of them caused a leak. Each was caught by an audit or by the first live run.

08.11 · found after the first live task

On-demand cloning baked https://x-access-token:<token>@… into the origin URL. The token sat in plain text in .git/config for the life of the clone: git remote -v shows it, and so does any output pasted into a bug report, or a backup.

What we did: the URL is clean; a credential helper reads the token from the environment. Old clones are fixed on next use. And since ADR-0022 the worker has no token at all.

08.11 · security audit, severity High

compose.yaml held a literal Postgres password, jarvis. Any process on the host could connect to 127.0.0.1:5433 and rewrite Jarvis's state, including permission decisions.

What we did: the password is generated and lives in Infisical. Compose takes it from the environment and refuses to start without it.

10.11 · found on the jarvis-01 server

The jarvis user was in the docker group. That is effectively root: any child claude with Bash could mount the host disk into a container and read /etc/jarvis/infisical.env.

What we did: removed the user from the group. The runbook now forbids it; only root runs Docker.

08.11 · the “Bad credentials” error

It looked like a bad token. Actually the GITHUB_TOKEN= line in ~/.jarvis/.env was empty, so the container got nothing. The second source had drifted from the first without anyone noticing.

What we did: the token comes from Infisical. We regenerate .env with infisical export and never edit it by hand.

10.11 · during server setup

The client secret of the Infisical machine identity passed through a chat with an assistant. Technically that's not a leak, but we no longer control where that text is stored.

What we're doing: rotating it. Anything that's been in a chat, log or screenshot counts as compromised.

Problem 07 · access and working without the laptop

An agent on a laptop is reachable only from that laptop and sleeps when it does. How do we reach it from anywhere?

A task runs 20–40 minutes. Close the lid and the work stops. You can't approve a spec from your phone either.

A

Keep it on the laptop

  • nothing to set up
  • access only from that machine
  • sleep stops the task
starting point
B

VPS with a public address

  • access from anywhere
  • UI and subscription login exposed to the internet
not done
C

GitHub App + webhook via a tunnel

  • instant events
  • public address or a tunnel
rejected · ADR-0007
D

VPS + tailnet

  • access from all your devices
  • no inbound ports
  • no webhook, so polling
✓ our choice
Problem 07 · topology

An agent on a laptop is reachable only from that laptop, so Jarvis lives on a server in a tailnet

TAILNET · OWNER'S DEVICES ONLY Laptopor phoneHTTPS · *.ts.net HETZNER VPS · USER JARVIS · SYSTEMD tailscale serve:443 · tailnet only 127.0.0.1 · LOOPBACK jarvis-web:5180 jarvis-engine:4310 Postgres:5433 · Docker claude -psubscription login in the jarvis user's ~/.claude all services listen on loopback · SSH via tailscale ssh INTERNET ✕ UI not visible from outside Infisicalprod · read-only GitHubpush · PR · polling Notion · Google Docsvia connectors
FIG. 7.1 · network · ADR-0016tailnetVPSexternal services

The server only makes outbound calls. GitHub can't send it a webhook, so the watcher polls GitHub itself.

Problem 07 · what a tailnet gives

A tailnet locks down access to the server, but doesn't replace the safeguards inside it

What it gives
  • A private HTTPS address. The UI opens from laptop and phone, and the internet can't see it.
  • SSH with no open port. Log in via tailscale ssh; port 22 can be closed in the firewall.
  • Phone as a remote. Approve a spec or answer the agent on the go.
  • The subscription login stays hidden. It lives on the server, and only the owner's devices are in the tailnet.
  • Losing the tailnet means losing access, not data.
What it doesn't
  • Notifications. Nothing tells you a card is waiting. Slack adds this in iteration 2.
  • Protection from the agent itself. What it does inside the server is limited by permissions and allowlists, not the network.
  • Inbound webhooks. That's why we poll PR status instead of receiving it.
  • Backups. The host holds state: the database, ~/.jarvis, ~/.claude. Daily Hetzner snapshots cover them.
Problem 08 · untrusted text

A PR comment can contain a command. How does the agent tell data from instructions?

Prompt injection: an instruction in a review comment or CI log looks just like an instruction from the engine.

A

A prompt rule + CLI protection

  • already in place
  • not enough for text we assemble ourselves
rejected · ADR-0017
B

Filter out commands

  • “clean” text
  • no filter detects them reliably
  • mangles the comment
rejected · ADR-0017
C

<untrusted-content> + report

  • the model sees the boundary
  • attempts go to the owner
  • the engine can't wrap text the model fetches itself
✓ our choice
D

Dual LLM / CaMeL

  • privileged model never sees the data
  • more complex, more runs
not done
Problem 09 · memory and self-learning

Every run starts from zero. How does an agent learn without cluttering its own context?

Whatever the agent figured out during a task is lost when the run ends. The next task repeats the same mistakes.

A

An approval card for every entry

  • safest
  • the owner becomes the bottleneck
rejected · ADR-0021
B

Raw log + a distiller run

  • nothing gets lost
  • costs a run, guesses at duplicates
rejected · ADR-0021
C

Split across 3 files

  • every fact in its place
  • 3 write paths
rejected · ADR-0021
D

A single self-maintaining file

  • date and a ✓/✗ counter
  • nothing disappears on its own
  • not yet tried on a live task
✓ our choice
Problem 09 · memory

The agent records what it learned, and later tasks confirm or refute it

~/.jarvis/USER.mdformat from USER.example.md
## Learned
- m3 [owner · 2026-11-09 10:42]
  Summaries in Ukrainian, code and PR text in English.

### owner/name
- m7 [agent · T-14 · 2026-11-14 16:05 · ✓4 ✗0 ·
     last T-31 2026-11-20 09:12]
  Dates go through `formatDate()`.
  (src: lib/date.ts:12, …/pull/41#discussion_r1)
agent / ownerwho wrote it: the agent itself or the owner ### owner/namethe entry applies only in this repository ✓4 ✗0how many tasks confirmed and refuted it src:the worker opens this spot before relying on the entry
A fact that will be needed againcheck: “will it recur?” note_insight Entry in ## Learned✓0 ✗0 · date · src confirmed contradicts confirm_insight✓+1 · last T-n entry with ✗never auto-deleted memory-review on requestonly the owner cleans up
FIG. 9.1 · life of an entry · ADR-0021tests only
Problem 09 · loop

The self-learning loop: code does the counting, the model draws conclusions, eval decides whether a change ships

01 · JARVISTask runjournal, usage, stop reasons 02 · JARVIS · ADR-0020retro-input.mdengine SQL, no model 03 · PROPOSEDRetro rolethe model only reads and writes 04 · HUMANThe owner decidesranked proposals 05 · CHANGEskill · prompt · USER.md1 change at a time 06 · DEVDIGESTEval gateeval:quality · benchmark 1 loop = 1 lessonarithmetic in SQL · judgment in the model · decisions with the human
FIG. 9.2 · feedback loopcodemodelhumaneval
Problem 10 · cost and oversight

How do you see what the agent does and what it costs, and stop a runaway loop?

On a subscription there's no bill to arrive and raise an alarm. A runaway loop quietly burns through your limits.

A

No limits

  • nothing gets in the way
  • the first runaway loop burns a whole day
common approach
B

Limits in env or in a DB with a UI

  • easy to change
  • another dependency or migration
rejected · ADR-0005
C

Config + CLI flags + console

  • --max-turns, --max-budget-usd
  • daily token limit
  • every event in the console, OTel in Grafana
  • cost is visible only at the end of a run
✓ our choice
Demo · live run

We give it a task in chat and watch what happens inside

Jarvis · Chatmockup, not a screenshot
Add a course syllabus page to the learning app. Find the lesson structure in Notion and the UI requirements in Google Docs. Show the spec and plan, build the page and prepare a PR.
IntakeGot it. Task T-n, branch jarvis/T-n.
ContextRead the repo and sources, context.md is ready.
Spec ReviewSpec and plan are waiting for your Approve.
ImplementingWriting code. Updates in chat every minute.
ReviewingReviewer: no blockers.
PR OpenChecks green, draft PR opened. Watching CI.

What to show along the way

  1. Tasks: the task changes stages without a page reload.
  2. Run console: every tool call as an event.
  3. Spec card: open context.md and spec.md, trace a requirement back to its source.
  4. Usage: all tokens of the run, cache included, and the daily counter.
  5. Thread: the task's model, Hold and Resume, “Send now” for a queued message.
  6. Connections: probes for GitHub, the database and connectors.
  7. GitHub: a draft PR from the bot account.
Demo · result · task T-3, 08.11.2026

The first live run got to a PR and exposed 4 problems the tests had missed

Permission cards

The run hung on &&

Narrow command permissions don't work with compound commands.

Bash is allowed in full; a deny list does the work.

Watcher

It watched the wrong repository

It looked for PR #38 from quick-blog in the default repo and got Not Found forever.

The watcher now passes the task's repository.

Token

The PAT ended up in .git/config

The origin URL contained the token in plain text.

A clean URL and a credential helper.

Chat

The chat looked dead

The agent ignored a soft request in the prompt to “post progress”.

The engine posts updates itself: after 30 seconds, then every minute.

Takeaway: anything that must happen is done by engine code. A prompt is good for style, not for guarantees.

Course · AI Agentic Engineering

Every mechanism you saw today has its own lesson in DevDigest

What we saw in JarvisLessonWhat we build in DevDigest
Run cost and limitsL01Run cost badge, severity filter
Skills and project rulesL02Skills in the product, Conventions extractor
Task context and diffL03Intent layer, Smart Diff
Tools via MCPL04The devdigest-mcp server, Blast Radius
Docs and project contextL05Project Context Folder, Onboarding generator, PR Brief
Checks, plan-verifier, CIL06Eval pipeline, Secret and Phantom gates, Plan Verifier, Export to CI
Roles, run console, memoryL07Multi-agent review, Run Trace and Live Log, Persistent memory
Plugin and agent self-analysisL08Plugin export/import, agent quality dashboard, weekly digest
Course · DevDigest pipeline

In the course we take the pipeline apart step by step. Jarvis shows it running with the engine in charge

1 · SPEC-CREATORSpecificationspecs/NN-slug.md spec.md 2 · PLANNERPlanphases · paths plan.md 3 · IMPLEMENTERCodea plan task diff 4 · TEST-WRITERTests+ typecheck tests 5 · PLAN-VERIFIERVerificationplan ↔ code verdict a plan item isn't done 6 · WORKFLOW-RETRORetrodocs/retro/ledger lessons → skills and agent roles
FIG. 12.1 · roles from dev-digest/.claude/agentswrites codesend-backmanual
Course tasks

DevDigest's specs/ holds 16 features: from 01-run-cost-badge and 06-mcp-server to 12-eval-pipeline and 13-multi-agent-review. We run each one through this pipeline.

What Jarvis automates

The same chain without manual hand-offs: a task from chat, spec for approval, code, checks, review, draft PR and CI follow-up. The human still approves the spec and merges.

What's next · known gaps

5 things are still open, and we know how to close each one

GapWhat the risk isWhat we do about it
The UI-check container's network isn't filteredCode from someone else's repo in the container can reach the internetNo secrets in the container, worktree is read-only. Egress filtering is the next step.
A child process can read the engine's environment via /procA theoretical path to the GitHub tokenAccepted for a single-owner machine. Fix: a separate uid.
Cost is visible only at the end of a runMid-run there are events but no numbersThe CLI's own brakes: turn and budget limits per run.
No cost per subagentYou see what a subagent did, not what it costThe CLI gives no breakdown. We're waiting for it.
No messenger and no scheduleNobody is told a card is waiting. Nothing runs on a timer.Slack in iteration 2. Schedule: a cron hitting the API for now.

Not yet run live: the e2e suite, agent memory, engine-side checks, an environment plan from a live worker, the Google connector. All of it is covered by tests, none of it by a live task yet.

What's next · next steps

Next comes a live task on the server, then Slack and self-learning

NowFirst live task on the server

The server is up and services are running. What's left is a task from chat to PR with nothing going to sleep on the way.

Iteration 2Slack as a channel

Socket Mode with no public address, threads, approval and permission buttons. It also settles the notification question.

Built, awaiting a live runMemory and run retros

The agent records what it learned. After a long task, a separate run analyzes spend and suggests where to save.

ProposedNew task types and sources

A workflow registry and a single watch mechanism: PRs, and also jobs, releases and alerts.

Deliberately outside the prototype: several people sharing 1 agent, a second engine for cross-review, shared team channels. This is an agent for 1 person on their own subscription.

What's next · build it yourself

To build an agent like this you need a subscription, a repository and 3 answers

What you need
  • A Claude Code subscription (Pro or Max) and a single claude login.
  • A GitHub repository with tests and an AGENTS.md file that names the check commands.
  • A bot account with a fine-grained PAT for this repository only.
  • Docker for Postgres and the UI check.
  • Optional: a VPS, Tailscale and Infisical if the agent should run around the clock. On a laptop, ~/.jarvis/.env is enough.
Exercise · pick your task
  • What result do you need? 1 sentence you can verify.
  • Where should the agent look? Design, requirements, rules: name specific places.
  • How do you know it's done? The commands that must be green.

Add 1 requirement for the agent's behavior and 1 for the result format: these become your first lines in USER.md.

Questions and answers

Code holds the state.
The model thinks.
The human decides.

A subscription instead of an API, secrets in a single vault, a server with no open ports, merge left to the human.

UA