Have you consider asking your agent to set up basic permission deny rules to block dangerous commands? Just ask it and request that it shows you the config before applying it.
I can add some basic configs, but it seems kinda provider dependent, so I'm gonna need to do this differently for Claude, Cursor, and Codex. It will also require a custom pre-tool use plugin to allow something like "AI can generate DB migrations via CLI but cannot handwrite them", which is pretty annoying when I need a separate one per model
Ask HN: How do you guys stop coding agents from acting out of line?
11–13 of 13 posts
Re: Ask HN: How do you guys stop coding agents from acting out of line?
#12Have you consider asking your agent to set up basic permission deny rules to block dangerous commands? Just ask it and request that it shows you the config before applying it.
I can add some basic configs, but it seems kinda provider dependent, so I'm gonna need to do this differently for Claude, Cursor, and Codex. It will also require a custom pre-tool use plugin to allow something like "AI can generate DB migrations via CLI but cannot handwrite them", which is pretty annoying when I need a separate one per model
Here’s an example of shared hooks.
https://frontmatter.news/kinds/hook
This website also has markdown versions of pages and references source docs so you can point your agent to the page and ask it to crawl to the docs pages to reference the hook json definition.
Re: Ask HN: How do you guys stop coding agents from acting out of line?
#13What framework do you use for generating migrations? I can help share an example of what it might look like to write a hook for it. Or even your top 3 pain points.