News for hackers. Stuff that matters.
Re:A way to exclude sensitive files issue still open for Ope... by TheDong on Sunday June 28, 2026 @10:27AM (#48707596)
The difference is that git is a traditional programming tool which executes deterministically.

agents are not deterministic tools, they're not sandboxes or container runtimes or languages with capabilities models.

They're a way to run arbitrary commands.

It would be like saying that "xterm" should have a ".xtermnoexec" list of commands you can't run, or that VLC should have an option for actors it won't show.

terminals run shells which run commands, it's not really deeply aware of what commands your shell ultimately run, and it's not in xterm's job to setup a sandbox and strip out executables.

VLC displays pixels, it's not up to it to figure out if those pixels are a certain actor.

codex pipes text and tool calls back and forth between OpenAI's servers, and it barely understands what that text and those tool calls are, and especially if a given tool touched a file. If you want VLC to not display an actor, you need to add a layer on top of VLC to stop it displaying a list of movies. If you want codex to not display a file's contents, you need a layer on top of codex to prevent it going near that file.

Re:A way to exclude sensitive files issue still open for Ope... by SoftTalker on Sunday June 28, 2026 @10:52AM (#48707838)
bash actually has a "restricted" mode which is sort of like that. In restricted mode, the following are disallowed:

- Changing directories with cd.

- Setting or unsetting the values of SHELL, PATH, HISTFILE, ENV, or BASH_ENV.

- Specifying command names containing /.

- Importing function definitions from the shell environment at startup.

- Parsing the values of BASHOPTS and SHELLOPTS from the shell environment at startup.

... some other things mainly preventing you from escaping or disabling the restricted mode.

Re:A way to exclude sensitive files issue still open for Ope... by 8organicbits on Sunday June 28, 2026 @11:10AM (#48708016)
Does that work? I've never seen it used. It seems easy to escape.

The docs seem to suggest using alternate approaches.

> Modern systems provide more secure ways to implement a restricted environment, such as jails, zones, or containers.

https://www.gnu.org/software/bash/manual/html_node/The-Restr...

Re:A way to exclude sensitive files issue still open for Ope... by SoftTalker on Sunday June 28, 2026 @11:19AM (#48708115)
I don't think I've ever seen it used. I think the idea was back in the day when you wanted to let a user have a shell login (because that's the only way you could use a shared computer) but wanted to confine them to a specific directory and prevent them running anything that wasn't in the pre-defined PATH that you set for them.
Re:A way to exclude sensitive files issue still open for Ope... by ryoshu on Sunday June 28, 2026 @12:45PM (#48709033)
Can't you do that with regular Unix permissions?
Re:A way to exclude sensitive files issue still open for Ope... by tingletech on Sunday June 28, 2026 @12:50PM (#48709092)
You could also produce special purpose applications this way, say to provide access to the online library catalog, or a run a gopher client for use in a public terminal lab. Telnetting to a unix account running some sort of restricted shell was how these often worked.

A sibling comment I can't reply to asks if you can do with with unix permissions.

These were really intended for anonymous guest access, or at least often used for this purpose. You couldn't do the same things with the file permissions systems at the time.

Re:A way to exclude sensitive files issue still open for Ope... by 4ndrewl on Sunday June 28, 2026 @06:47PM (#48712546)
Back in the day we'd use chroot to achieve something similar

https://linux.die.net/man/1/chroot

Re:A way to exclude sensitive files issue still open for Ope... by SoftTalker on Monday June 29, 2026 @10:09AM (#48719488)
Yes, in reality you might use chroot, limited filesystem permissions, and a restricted shell as a belt-and-suspenders approach.
Re:A way to exclude sensitive files issue still open for Ope... by AdieuToLogic on Sunday June 28, 2026 @11:05PM (#48714321)
>> bash actually has a "restricted" mode ...

> Does that work? I've never seen it used. It seems easy to escape.

Yes, it does work for its intended purpose. It has often been used in combination with chroot[0] as well.

> The docs seem to suggest using alternate approaches.

>> Modern systems provide more secure ways to implement a restricted environment, such as jails, zones, or containers.

These approaches are not mutually exclusive with restricted shell use. For example, one could use FreeBSD jails to secure Apache httpd and/or Nginx and still employ a restricted shell to evaluate requests.

0 - https://man.freebsd.org/cgi/man.cgi?query=chroot&apropos=0&s...

Re:A way to exclude sensitive files issue still open for Ope... by 8organicbits on Monday June 29, 2026 @08:45AM (#48718566)
I'm seeing a ton of restricted mode escapes documented online, like https://0xffsec.com/handbook/shells/restricted-shells/ so I'm not so sure. When basic utilities like less, man, and awk can run subshells it's quite a mess.

Bash restricted mode needing a chroot may suggest that Claude also needs a chroot (or restricted file permissions, jail, etc).

Re:A way to exclude sensitive files issue still open for Ope... by AdieuToLogic on Monday June 29, 2026 @08:21PM (#48727065)
> Bash restricted mode needing a chroot may suggest that Claude also needs a chroot (or restricted file permissions, jail, etc).

I believe running coding agents within a jail/container is a "best practice" to limit their blast radius. At least, this is what people I respect have conveyed to me.

Re:A way to exclude sensitive files issue still open for Ope... by dns_snek on Sunday June 28, 2026 @12:37PM (#48708957)
> they're not sandboxes

Yes they can be, and Codex offers one. It uses Bubblewrap and seccomp on Linux which are perfectly capable of restricting filesystem access.

In a default setup every command is executed inside a restrictive sandbox and you're only asked for permission to run that command if the execution fails.

I don't necessarily think that it's a good idea to rely on these sandboxes as your only line of defense but that's absolutely a feature that they can, should, and do offer.