I'm not sure what commands you need sudo for, but if you trust your agents with it then running sudo visudo and adding this to the bottom:
# Replace last term with your target command.
agent_user ALL = (ALL) NOPASSWD: /usr/bin/gdb
will give your agents access to run just that command without being prompted. This is in addition to the Touch ID solution; it addresses y-fatigue by prompting you only for fingerprints when the agent is running something you haven't explicitly approved of in advance.
This year I've gotten into the habit of only running LLMs in containers which has been a nice alternative to worrying about it affecting my host OS.
While it often isn't malicious, it can "unknowingly" delete files you don't want it to, like rm -rf $STEAM_ROOT/appcache. If sudo or gdb is needed for debugging, a VM will give the agent all the access it wants.
I block Bash access and make it use Bun Shell. Works a treat for these cases. One I encountered was echo "$text" | jq ... which preprocesses \n (at least on my mac) and then jq doesn't like literal ␊. Not in Bun Shell!
Unlike the default approach, the PAM extension shows who is requesting that command and what command it is, so it's very easy to do a sanity check to make sure nothing bad is about to happen.
ryan-duve | a day ago
I'm not sure what commands you need
sudofor, but if you trust your agents with it then runningsudo visudoand adding this to the bottom:will give your agents access to run just that command without being prompted. This is in addition to the Touch ID solution; it addresses y-fatigue by prompting you only for fingerprints when the agent is running something you haven't explicitly approved of in advance.
This year I've gotten into the habit of only running LLMs in containers which has been a nice alternative to worrying about it affecting my host OS.
thedward | a day ago
If you don't trust the agent with full root, giving it the ability to run
gdbas root is not any safer.ryan-duve | a day ago
gdbwas intended to be a placeholder command to demonstrate syntax, not a recommendation.altano | a day ago
Agents aren’t malicious humans and guardrails aren’t the same as security.
kiyurica | 22 hours ago
While it often isn't malicious, it can "unknowingly" delete files you don't want it to, like
rm -rf $STEAM_ROOT/appcache. If sudo or gdb is needed for debugging, a VM will give the agent all the access it wants.pie_flavor | 18 hours ago
I block Bash access and make it use Bun Shell. Works a treat for these cases. One I encountered was
echo "$text" | jq ...which preprocesses \n (at least on my mac) and then jq doesn't like literal ␊. Not in Bun Shell![OP] modulovalue | a day ago
Thanks! I've added an addendum to the post with your suggestion.
frontsideair | 9 hours ago
I have this with a single flip using
nix-darwin:ianloic | 20 hours ago
Weird. This just works out for the box on Linux. I wonder why it requires all that setup on Mac.
iggle | 7 hours ago
kiwec | 11 hours ago
If you use Touch ID for everything, you're just re-building UAC. What's the point if it shows up so often you'll scan your finger by reflex?
[OP] modulovalue | 11 hours ago
Unlike the default approach, the PAM extension shows who is requesting that command and what command it is, so it's very easy to do a sanity check to make sure nothing bad is about to happen.