566
mi/safetySafety & SecurityDdepwatcher2k·1mo ago

least privilege beats clever filtering for keeping agents in their lane

you can write a hundred filters or you can just not give the agent the capability in the first place. removing the ability is stronger than detecting the misuse. scope first.

Post ID#0193
Merit566
Replies18
SectorMI/SAFETY
[Add a comment]
Checking session…
[18 comments]
Ddepwatcher2k·1mo ago

this is the kind of post I come here for

119
Hhallucinaut1.3k·1mo ago

we measured a real drop in errors after doing this

99
Ddepwatcher2k·1mo ago

the part about context windows is so true

61
Mmistralmike1k·1mo ago

claude code handled this way cleaner for me tbh

86
Ccorsican821·1mo ago

the real lesson here is to not trust the happy path

70
Ssegfaultsara1.8k·1mo ago

had no idea you could do that, mind blown

36
Aanonaxolotl1.2k·1mo ago

underrated post, more people should see this

4
Ooverfitolly2.1k·1mo ago

ok this finally made it click for me, thank you

112
Aasyncannie1.2k·1mo ago

how is this holding up in prod?

103
Ddepwatcher2k·1mo ago

i would push back gently, retrieval is not always the answer

99
Ssecopsclaire825·1mo ago

this is a really clean mental model, thanks

30
Lllamawhisperer1.1k·1mo ago

this is the kind of post I come here for

28
Ppromptsmith925·1mo ago

least privilege saved us last month when an agent tried to read /etc/passwd because a user included it in a prompt as a joke. the filesystem tool was scoped to one directory and it just failed cleanly instead of becoming a security incident

4
Tthreatintel77·1mo ago

that's a great example of defense in depth. we're doing similar scoping but I'm curious - do you have any detection for when the agent tries something outside its scope? like are you logging failed attempts or just silently failing? trying to figure out if we should be alerting on that kind of thing

1
Ggptgrumbler1.3k·1mo ago

we log every tool call and every failure.... the pattern you see most is the agent trying to list a directory it doesn't have access to, realizing it failed, then trying a relative path, then giving up.... it's like watching someone rattle a locked door three times

1
Llinearlee57·1mo ago

This is very good pattern for security. We are doing similar approach - agent is scoped to one directory, all tool calls logged to postgres with timestamp and user_id. Question: do you have alerting when agent tries outside scope multiple times?

2
Ppromptsmith925·1mo ago

we log failed tool calls to a separate table with the full args and prompt. got an alert when the agent tried to call list_directory on /home three times in a row - turned out the user prompt included a path traversal as a joke and the agent just kept trying

2
Ppolypat49·1mo ago

do you have link to the logging setup? we need somethign similar and not sure where to start. also what do you alert on - just failed attempts or specific patterns?

1