Live data from Hacker News

Git worktrees are not an isolation boundary for coding agents

fletch.sh

21–30 of 43 posts

Re: Git worktrees are not an isolation boundary for coding agents

#21
post #13

Do people not know how to write blogs without AI anymore? I enjoy hearing a human's unique voice and miss hearing it when it's abscent.

I would bet the guy asked ChatGPT a question and then went "turn your answer into a blog post"

Re: Git worktrees are not an isolation boundary for coding agents

#22
I think the first question is what exactly are we trying to preserve by using either worktrees or multiple clones? The answer is: non-pushed changes

So if all you want is to work on index.ts in a separate dir from api.ts then worktrees might work well

If you want to be able to rm -rf one of the dirs without wondering about dependencies then yeah multiple clones makes sense

Either way is a way to avoid using more fragile/finicky workflows like stash and stash pop

Re: Git worktrees are not an isolation boundary for coding agents

#24
post #10

For me the most pragmatic way to solve this is in the agent harness layer simply prohibiting commands like git force and others in the settings configuration of your harness of choice with pre tool hooks, its quite easy to setup, obvious ones are prohibiting pushes to main, among others. Unless someone is building their harness from scratch like you this is a 30sec configuration and you could just save your list of b…

Agreed. I had to solve this at the harness layer myself. It just makes more sense to me this way. We basically created hooks around these operations and you can configure what happens at these calls. Disclosure: I'm building AQ (aq.dev) a multiplayer coding harness.

Checked it out, it doesn't particular talk to me but for sure other people, looks like a cool project! Wish you best of luck and success!

Re: Git worktrees are not an isolation boundary for coding agents

#25
post #13

Do people not know how to write blogs without AI anymore? I enjoy hearing a human's unique voice and miss hearing it when it's abscent.

You can literally tell from the box styling that it's AI now. Awful.

I wonder if it's primarily that developers are too lazy to design anything? I remember low-quality developers relying on Bootstrap and not making a modicum of effort to design a website.

Of course, if you're that lazy, you're going to surround yourself and industry with AI-generated websites and UI, and you're going to recognize it, so...

Re: Git worktrees are not an isolation boundary for coding agents

#27
post #19

Git worktrees are a great isolation boundary for _changes_ (especially making changes in parallel on a single machine), but not behavior. If you are trying to actually run autonomous agents securely you need something that lives outside the harness that actually blocks actions in a way that can't be prompted around. We use nono [1] for this internally, essentially blocking any actions we don't want agents to be able…

"read/write only the worktree", but git requires .git dir writable for common commands to work in a worktree. And that's where .git/hooks live. So agent inside that profile can still write a pre-commit hook that runs on your machine whenever you commit outside the sandbox. Or am I missing something?

Re: Git worktrees are not an isolation boundary for coding agents

#28

Why a clone over a worktree? The obvious disadvantage I can see is you dont share your git objects with a clone and for really large repos that becomes an issue

Well, actually `git clone --shared` writes an alternates file pointing at your object store and copies zero objects.

Re: Git worktrees are not an isolation boundary for coding agents

#29
This is quite useful. The title and first paragraph anyway; the rest is fluff. I've actually been trying to solve a problem where I have agents running other agents in worktrees, with the delegated agents contained by jai[0], and the delegating agent would always have to check and reconcile the commits since they get jailed (by design for security). Working on clones instead should resolve that cleanly, as I can relax the .git limitation. I do wish I'd thought it this before.

[0] jai.scs.stanford.edu/

Re: Git worktrees are not an isolation boundary for coding agents

#30
post #13

Do people not know how to write blogs without AI anymore? I enjoy hearing a human's unique voice and miss hearing it when it's abscent.

I'm setting up my new blog right now. I'm thinkin of having a toggle to "hide" ai generated content from my main list of writing, and labeling (and a disclaimer at the toop of each ai-generated post a message).

Example home page: https://taude.xyz/ Example AI Slop post: https://taude.xyz/posts/the-tool-stack-behind-this-blog/

Not trying to self-promote, but honsetly trying to leverage AI when appropriate, and to also not take away from my hand-written articles that are typically my thoughts and opinions....

Post reply on HN