vegardjorg.github.io
Vegard Cowie Jørgensen
Software architecture, security and AI-assisted development, with a particular interest in systems where correctness and security do not depend on the AI behaving as expected.
Areas of focus
Security architecture for AI in business systems
- Access: The AI gets only the user's permissions, enforced in the database and not in the prompt.
- Attacks: Prompt injection and red teaming against my own AI features.
- External agents: MCP and OAuth, with controlled disclosure and protection of small numbers.
Secure and efficient development with coding agents
- Checks: Nothing is merged until the checks are green on the same commit. The agent does not control the checks itself.
- Review: The agent never approves its own work.
- Cost: Token use and context are measured per task.
Articles
Lessons from my own work
Projects
Ravenseat
Engineering discipline for Claude Code agents. Evidence over trust.
In my experience, AI agents that write code today have clear weaknesses: obvious security holes, instructions that are forgotten and important context that disappears during compaction. Ravenseat is my deep dive into how some of them can be contained.
It is a coordination layer around Claude Code that runs a whole project from one conversation. The queue, plans and decisions live in files, not in the context, so the work survives compaction, crashes and restarts. The agents work in parallel, each in its own worktree; nothing is merged until the project's own checks are green on that exact commit.
Ravenseat is not a security sandbox. The agents run as my own user, and hooks look at the commands, not at everything they do. Green checks do not prove that the software is correct either. That is why the checks live outside the agent, and review is done by other agents than the one that delivered.
Choices that need judgment, such as architecture, the data model and security tradeoffs, go back to the owner with a recommendation. The rest of the queue keeps going. With Ravenseat I aim to put what I learn at university into practice: software architecture, development processes and security.
Built with Claude-
Isolation
- One fresh agent per task, with its own worktree, its own branch and a brief written to a file
- Ownership per file: two tracks never touch the same files at the same time
- Dependencies set the order, and merges happen one at a time under a lock
- A red check gives a fix round, at most three, then a question to the owner
-
Guards around the agents
- Hooks block pushes and writes to control files; if a guard runs out of time, it blocks
- A new
.onlystops the merge; deleted tests and emptied asserts are flagged - Optional secret scan of every commit before merge
- Red team suite in CI on Linux and Windows
-
Independent verification
- The check result is bound to the commit SHA, and merge reads only that record
- The agent never approves its own work: separate review agents by risk class, including one that tries to disprove the delivery
- Reports, handovers and owner decisions are written to files, with a log of every override
- The queue files are written transactionally with a journal, so a crash in the middle of a write is repaired instead of corrupting them
-
Cost under watch
- Compaction at 300k: in one measurement, median context per turn fell from 464k to 183k
ravenseat costper task: flags unusual token use and unnecessary file reads- An optional daily budget stops new starts
- When nothing can run, the queue waits without using tokens