# Speed up code reviews by derisking them: open sourcing Trellis

When checks rule out catastrophic bugs, reviews can be fast. Trellis holds those checks in place and stops agents switching them off.

By [Rob Yates](https://grovehq.com/blog/author/rob-yates), December 2, 2026

![Leafy green vines climbing a square trellis. Four of the trellis crossings carry file labels: CODEOWNERS, eslint.config.js, auth gate and db/client.js. A gold fingerprint sits at the centre of the frame.](https://cdn.sanity.io/images/u4k4nps9/production/f65abd6976ec7c4f5e1ef48edafddec90598b7e8-2400x1260.jpg)

In the [software factory post](https://grovehq.com/blog/software-factory) I called the PR review the biggest bottleneck on the dev side of the factory, and said the first thing we did about it was to derisk it. I also promised a follow-up on how. This is that post, and it comes with a repo: today we’re open-sourcing [Trellis](https://github.com/grove-hq/trellis), the thing we built to do it.

## Why it’s needed

**Review is only as fast as the worst thing a PR could contain.** Most bugs are annoying. You find them, you fix forward, nobody remembers by Friday. A few are a different kind of thing altogether: a route that ships without an auth check, or one tenant’s data reaching another tenant. You can’t afford those even once. And because any PR might be carrying one, every PR gets read as though it is.

That was tolerable at 36 merged PRs a month. At 572 it isn’t, and it gets worse with where we want to go next. Our agents already open PRs, test them against a preview and mark them ready. Separate agents, with some human oversight, can already approve PRs in specific situations. The obvious next step is to let agents make more of those decisions on our behalf, up to and including approving and merging each other’s PRs.

The moment you say that out loud, the question is what stands between an agent-written change and production when no human reads it. “We told the agent to be careful” is not an answer. As I said last time, if you’re a gambler and feeling lucky, an all-caps checklist in a prompt maybe works 95% of the time. For this class of bug, most of the time isn’t good enough.

**The real answer is architecture.** If every route is built from one auth wrapper, and every query goes through one tenant-scoped client, then as long as the pattern is followed, whole classes of bug are unreachable. Nobody has to remember anything.

It also changes what review has to ask. “Is this change safe?” takes a person, on every PR. “Does this change follow the pattern?” doesn’t. A lint rule can answer that by reading the code: every import and every call site. The machine reads all of it, every time, and is no less careful at PR 400.

The catch is in “as long as the pattern is followed”. Classic tooling assumes an honest author who occasionally slips. A coding agent is a different animal. It has a red build and a strong wish to make it green, and to get there it will strip the auth wrapper, cast past the type, add `--no-verify`, or edit the failing rule itself. None of that is malice. It is just the shortest path, and an agent takes the shortest path.

So you need two things:

- **Checks that fail the build** when code steps around a pattern.
- **A human who ratifies any change to those checks**, because a check the agent can switch off is only a suggestion.

That is Trellis. It puts a gate on the very important parts of the codebase, and it means the gate can’t be quietly moved. Everywhere else, the agents can get on with it. That is where the speed comes from: when a PR doesn’t touch the guarded parts and the checks are green, the catastrophic question has already been answered, and review (human or agent) can spend its attention on whether the change is any good.

## The trellis and the vine

**A trellis is a frame that a plant grows along.** The gardener doesn’t place each shoot. They build the frame, and the plant fills it in at its own speed, in the shape the frame allows.

A codebase written by agents grows the same way. You can’t inspect every line (we stopped trying a while ago), but you can build the frame. The frame is a small set of files that decides the shape of all the other code: the code written last year and the code an agent will write next month. All of it has to stay on the frame.

![Vines growing up a trellis. A pointer from “The frame” lands on the trellis: a few files that hold the architecture, where a human ratifies every change. A pointer from “All the other code” lands on a vine: code agents write and merge freely, which grows along the frame. A dashed zone across the top, labelled “Not written yet”, holds faint outlined vine tips: code agents will write next month, which has to grow along the frame too.](https://cdn.sanity.io/images/u4k4nps9/production/abdfb628901890432dff5ab47e9fce55cf12f524-2560x1440.png)

### What a frame is

In practice the frame is the handful of files that hold your architectural invariants: the lint rules, the types, the dependency rules, the CI workflows that run them, and the few pieces of real code everything else is forced through (the auth gate, the scoped database client). You declare it as a marked block in `CODEOWNERS`, where each entry names a path and the person who may ratify changes to it:

```
# trellis:frame-begin
/.github/CODEOWNERS      @alex
/.github/workflows/      @alex
/.trellis/               @alex
/eslint.config.js        @alex
/src/db/client.js        @sam
# trellis:frame-end
```

The rule is simple. An agent can propose a change to a frame file like any other change. It can’t land one. A PR that touches the frame fails a required check, and stays red until that file’s owner has signed that exact change with [**proof of presence**](https://www.biometricupdate.com/202610/what-proof-of-human-presence-must-mean-when-ai-agents-ask-for-approval): evidence that a real person was there at the moment of sign-off, and not just that their credentials were used. With agents that distinction is the whole game, because an agent working on your machine has your credentials. The agent may propose anything and ratify nothing.

**The frame is kept small.** What goes in should strive to be the smallest amount of code that holds the invariant. A small frame is one a human can actually read when asked to sign a change to it, and it leaves everything outside free for agents to change. In our codebase that is where I still read code. Everything else gets the high-level review I described last time.

### What you get in the repo

There are three things in it.

1. **A framework that makes the frame something only a human can change.** That is the required check and the signing (next section). Nothing about it is specific to lint rules. It works for any sensitive file where you want to know that an agent has touched it, and want a human to sign off before the change lands.
2. **Utilities for the checks that go in a frame.** These are the small ones we kept needing: plain text matchers for the moves that switch a check off, and a few ESLint rules for the places where ESLint, dependency-cruiser and friends ran out.
3. **Patterns.** The common architectural guarantees and how to hold each one, documented in the repo and demonstrated in the sample app.

The check in CI is the only part that binds. But finding out at CI is slow, so the same rules also run earlier as feedback: when the agent edits a file, when it ends a turn, at commit and at push. The gate doesn’t move. The agent just meets the failure in seconds, with a message that says what the invariant is and what to do instead.

## Signing: proof that a human was there

**An approval on GitHub does not prove a person looked.** This is the part that took us longest to get right, and it is the part I’d most like feedback on.

The agents on my machine work with my GitHub token, so to GitHub they are me. An approving review from one of my sessions is, as far as any branch rule can tell, my approval. That is why ratifying a frame change in Trellis means signing it, with a key that only signs after a physical act. The signer we ship uses Touch ID, with the key held in the Mac’s Secure Enclave. An agent can do everything up to that point. It cannot put a finger on the sensor.

Video: [Trellis demo](https://www.youtube.com/shorts/AXKcuE3R8dc)

It takes four steps, and the owner reads the changes before signing them:

![How a frame change gets signed, in four steps. An agent can do every step except the fingerprint. 1: A PR changes a frame file. The Trellis check goes red and names the file. 2: The owner runs trellis ratify on the PR. It lists each frame change, with a link to it, and prints a code. It signs nothing. 3: Having read the changes, the owner runs it again with the code. Touch ID asks for a fingerprint, and the signature is posted as a comment on the PR. 4: The check runs again and goes green. Peer review still applies.](https://cdn.sanity.io/images/u4k4nps9/production/657621bb82a1a6809ea3d83b1a7ee5e2d993923f-2560x1180.png)

A few details carry the weight:

- **The signature covers the content, not the PR.** What gets signed is each changed frame file, before and after. Push again without touching the frame and the signature still holds. Change a frame file again and it needs signing again.
- **It can’t be replayed.** The statement includes the PR number and the starting content, so a signature can’t be lifted onto another PR, or onto the same change from a different starting point.
- **It doesn’t matter who posts it.** The signature is the authority, not the commenter. An agent can prepare the statement and post the result. It just can’t produce the bit in the middle.
- **It replaces the owner’s approval, not peer review.** The PR still needs an ordinary approving review from someone else.

And one thing it cannot do: make the owner read. An agent can raise the fingerprint prompt, and a human in a hurry can press it. The two-step command exists so the changes are in front of you before you sign. That is as far as software goes. The rest is on us.

## The utilities

**The utilities are the small checks we kept reaching for.** None of them is clever. Each exists because we watched an agent take a particular shortcut more than once.

### The text matchers

The first thing an agent does when a check is in its way is switch the check off. The switches are ordinary text in ordinary files: a comment above a line, a flag on a command, a value in a `package.json`. You can’t put every source file in the frame, so the frame alone doesn’t cover them. Two plain text matchers do, and they are deliberately simple.

- **Banned text.** A list of strings a PR may not add, such as `eslint-disable`, `@ts-expect-error` and `--no-verify`. It only reads the lines a PR adds, so the code you already have never blocks anyone. Legitimate exceptions go in the same list, next to the ban they are an exception to. The list is a frame file, so an agent can propose an exception and only a human can grant one.
- **JSON pins.** Some guards are a single value in a file that is otherwise free to change. The `lint` script in a `package.json` is the usual example. A pin holds one key to one value, so that script can’t quietly become `echo ok`, and the rest of the file stays open.

Every ban and every pin carries a `why`, which is what the agent sees when it trips one. Write there what to do instead. A check that explains itself gets fixed, where one that just says no gets worked around.

### The ESLint rules

Most of our checks are ordinary ESLint and dependency-cruiser rules, and you should start there too. We wrote our own only where those couldn’t say what we needed.

- **Import fences.** A fence makes one file the only way to reach a module: the database driver that is only safe behind the tenant-scoped client, or an SDK that has to sit behind one wrapper. Everything else that imports it fails lint, with a message saying where to go instead. A fence can also leave a module’s safe exports open and close the rest, which the off-the-shelf rules couldn’t do for us.
- **Literal dynamic imports.** A computed `import()` is the one import a fence can’t read, so this rule bans them. It comes on with the fence.

Both are on npm as `@grovehq/trellis`.

**Grove plans the work before your coding agents start**

It works out what to build with your team, hands your agents a plan they can follow and checks what comes back.

## The patterns

**A pattern is an architectural guarantee plus the way to enforce it.** The framework only says who may change the frame. What you put in it is where the value is, and that is different for every codebase. What we can share is the patterns we’ve ended up with at Grove, and the handful of techniques that keep turning up underneath them.

One test tells you whether something can be a pattern at all: can a machine confirm it by *reading* the code (its imports, call sites, wrappers and types), or only by *running* it? If reading is enough, it can be enforced for all code, including code not written yet. If it needs running, it’s a test. If it needs judgement, it’s review.

Here are three, at a high level. Each will get its own post soon.

### Authentication

*No request reaches a handler without an authenticated caller.*

Put one gate in front of every route, and keep the routes anyone may call (the login page, a health check) as an explicit list in one file. Handlers don’t each decide whether to authenticate. A new route is authenticated because it exists.

The technique is **refuse by default, with one list of exceptions**. The frame is three small things: the gate, the public list, and a check after the build that the gate really does sit in front of every route served. An agent adding an ordinary route needs no human. An agent making a route public, or changing how the gate verifies a caller, does.

### Tenant isolation

*No query reads or writes another tenant’s data.*

Give the database one door: a tenant-scoped client that adds the caller’s tenant to every query. Handlers ask it for data and never write the tenant filter themselves, so there is no filter to forget.

The technique is **one door, and no way to build another**. An import fence (one of the utilities in the repo) makes the scoped client the only file allowed to import the database driver, so nobody can open a second connection around it. The frame is the scoped client and the lint config that declares the fence. A new handler needs no human. A new method on the scoped client, the “list everything” someone wants for an admin page, does.

### UX tokens

*Every color and every measurement in the UI comes from the design system.*

This one is here to make a point: the frame is not only for security. A design system gives names to its values. There is a named color for a muted border and a scale for spacing, and a value with a name renders correctly in light mode, dark mode and each brand theme. An agent asked to nudge a layout will happily write `text-[11px]` or `bg-blue-100` instead. It looks right in the screenshot it took, wrong in dark mode, and a hundred of those later the product no longer looks like one product. No reviewer catches that by reading a diff.

But it is confirmable by reading the code, so it can be a pattern. A lint rule checks that every styling value traces back to a token. The legitimate exceptions (there are always a few) live in a list inside the frame, so adding one is a signed change and not a free pass. The same idea covers components: use the design system’s button, not a hand-rolled one. The result is that agents can build UI all day and the design system still holds.

### What comes next

Those three are a start. Others we rely on include capability types (a value that proves a check has already happened, so the code that needs the check can’t be called without it), fences around powerful SDKs, banned constructs, and a version bump whenever a shipped artifact’s bytes change.

Over the coming weeks we’ll write each pattern up in detail: the guarantee, the ways it fails, what goes in the frame, and what it doesn’t cover. As we do, we’ll add it to the [sample app](https://github.com/grove-hq/trellis-sample), so there is a small working codebase to copy from. Authentication and tenant isolation are in there today.

## What Trellis does not do

**Trellis checks that a mechanism is present and reached the right way. It does not check that the mechanism is correct.** A gate that authenticates the wrong thing passes. Please don’t adopt it and assume your agents now write secure code. It focuses your attention where it is needed most. The patterns that make your agents produce the right code are specific to your codebase, and you still have to design them, review them and red team them.

It is also built against shortcuts, not sabotage. It stops an agent, or a person in a hurry, from taking the short way round a guard. It is not a defense against someone deliberately trying to hide a change. Peer review is what stands against that.

## Try it

Trellis is on GitHub under Apache-2.0: [github.com/grove-hq/trellis](https://github.com/grove-hq/trellis). The README has the short version of everything above. The framework is a folder you copy into your own repo (on purpose: the gate should live in your frame, where its owner has read it), and the ESLint utilities are on npm as `@grovehq/trellis`. The [sample app](https://github.com/grove-hq/trellis-sample) shows it all working.

As with the last post, we’re sharing this partly because others might find it useful and partly because we want to hear where it’s wrong. We’re all still working this out. If you try it, or you’ve solved the same problem a different way, I’d love to hear about it.

**Give your agents a plan to follow**

Grove plans each project with your team and checks every pull request against it.

## More on this

- [Technical founders and CTOs](https://grovehq.com/solutions/ctos): When writing specs eats an engineering lead’s week.

## Keep reading

- [Grove’s software factory](https://grovehq.com/blog/software-factory): Coding agents sped up the writing of code, not the factory. The three bottlenecks we hit, and how our three-person team went from 36 to 572 merged PRs a month.
- [I was the CEO slinging Claude Code PRs at my team](https://grovehq.com/blog/ceo-slinging-prs): Shipping more with coding agents? Check how many PRs just clean up last week’s. Almost half of ours did, until three changes cut it to one in seven.

## Written by

**[Rob Yates](https://grovehq.com/blog/author/rob-yates)**. I write about running a software factory: how we set up coding agents at Grove, what they need from a spec, and how we check what they build.

## Get started

- **Set Grove up with your team:** Grove does the product work around your decisions. If Grove fits, you get two weeks free on what you’re building now. [Try Grove free](https://grovehq.com/?waitlist=open&utm_source=markdown)
- **Talk to Grove’s founders:** Thirty minutes on how your team decides what to build. You leave with our read on it. [Book a call](https://grovehq.com/?book=call)

---

Canonical URL: https://grovehq.com/blog/trellis-open-source

[Try Grove free](https://grovehq.com/?waitlist=open&utm_source=markdown)
