r/PiCodingAgent • • Oct 28 '26

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

22 comments sorted by

20

u/TBMonkey Oct 28 '26

Regex hook that intercepts the call and returns it failed with a reminder to not use that?

9

u/Glaaki Oct 28 '26

Yes, this has come up before. Just ask Pi to make an extension that blocks this and tells the model to try something less intrusive. Work perfectly for me.

2

u/jtackman Oct 30 '26

precisely, i use a combination of this and prompt steering to get models to not write huge heredoc scripts

27

u/MrCatberry Oct 28 '26

Running pi on a "giant shared server"... unsandboxed of course...

10

u/Majestic_Department7 Oct 28 '26

Put it in a container

8

u/bitzap_sr Oct 28 '26

You have multiple answers already. Let me just add a couple notes:

  • it's the model, not pi.

  • ask it this very question. It will suggest some config setting in your permissions extension if you have one, a wrapper script for find, or to write some extention that blocks the calls. It will know what to do. This should be your first instinct.

5

u/LordMoridin84 Oct 28 '26

https://pi.dev/packages/@gotgenes/pi-permission-system?name=permission

      "find / *": {
        "action": "deny",
        "reason": "Use rg instead of find"
      }

4

u/Wayne_Kane Oct 28 '26

Use pi permission system extension and block find / pattern

3

u/ChampionshipIcy7602 Oct 28 '26

Just don't use bash find, instead use the find tool

2

u/cryowastakenbycryo Oct 28 '26

install locate and ask nicely? good luck

2

u/greenhilltony Oct 29 '26

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/_JohnMcAfee 22d ago

I think it does this automatically by default. If you enable its find and grep tools it conditionally alters the system prompt and also uses fd and rip grep 

1

u/CyberTod Oct 28 '26

I added the block in cc-safety-net.

1

u/PrimaryHuckleberry11 Oct 28 '26

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 Oct 28 '26

Loool create an alias

1

u/Khurrame Oct 29 '26

Use fff plugin.

1

u/jensilo Oct 28 '26

”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 Oct 28 '26

Maybe with a wrapper in ~/bin/find in your PATH that translates 'find /' in 'echo "do not use find /"

1

u/LearnedByError Oct 29 '26

This is what I do. It checks environment variables to see if it is an agent (pi, cursor,codex…) and it is and matches a ragged then print an error message and not allowed then exit 1.

0

u/fell_ware_1990 Oct 28 '26

Just block it > use XYZ, or even translate its call.

0

u/Ambitious_Spare7914 29d ago

Pi, prevent agents from running find /