r/PiCodingAgent • u/Simusid • 28d ago
Question Stop Pi From Running find /
I'm on a giant shared server and "find /" might take an hour. I've been unable to persuade pi to stop issuing it. In settings.json I changed defaultTools to defaultTools": ["read", "bash", "edit", "write", "grep", "ls"] and in AGENT.md I added a rule "don't ever run find /" and similar message in my README.md but it continues to issue "find /"
How can I enforce this?
11
Upvotes
20
u/TBMonkey 28d ago
Regex hook that intercepts the call and returns it failed with a reminder to not use that?
27
u/MrCatberry 28d ago
Running pi on a "giant shared server"... unsandboxed of course...
10
u/Majestic_Department7 28d ago
Put it in a container
8
u/bitzap_sr 28d ago
You have multiple answers already. Let me just add a couple notes:
5
u/LordMoridin84 28d ago
https://pi.dev/packages/@gotgenes/pi-permission-system?name=permission
4
u/Wayne_Kane 28d ago
Use pi permission system extension and block find / pattern
3
u/ChampionshipIcy7602 28d ago
Just don't use bash find, instead use the find tool
2
u/cryowastakenbycryo 28d ago
install locate and ask nicely? good luck
2
u/greenhilltony 28d ago
Let Pi write an extension to intercept calls with `find` and to hint the model to use `fd`. I did the port to TS from my Claude Code plugin: https://github.com/TonyWu20/no-find-grep
1
u/CyberTod 28d ago
I added the block in cc-safety-net.
1
u/PrimaryHuckleberry11 28d ago
for me it was enough to instruct in AGENT.md not to use it ever for / But even if I say to disallow it for all, it still respect this guardrail. What model are you using?
1
u/o_sht_hi 28d ago
Loool create an alias
1
u/Khurrame 27d ago
Use fff plugin.
1
u/jensilo 28d ago
”Stoppning pi from doing x“ is like saying „stopping my car from driving in the wrong lane“. It’s the driver, not the vehicle.
1
u/ali0une 28d ago
Maybe with a wrapper in ~/bin/find in your PATH that translates 'find /' in 'echo "do not use find /"
0
u/fell_ware_1990 28d ago
Just block it > use XYZ, or even translate its call.
0
u/Ambitious_Spare7914 25d ago
Pi, prevent agents from running
find /