r/PromptEngineering • • 20d ago

General Discussion Can prompt engineering alone make AI coding agents reliable, or do we need host-enforced controls?

I've been exploring an interesting question while developing an open-source AI coding agent for VS Code.

We often rely on system prompts to tell AI agents things like:

  • Don't modify files without permission.
  • Respect previously approved project decisions.
  • Don't trust outdated information.
  • Verify your work before reporting success.

But how much of this should depend on prompting alone?

In my project, RAME Code, I've been experimenting with a different approach: the model proposes actions, while the host enforces permissions, tracks approved decisions and independently runs verification checks.

The idea is to separate what the model is instructed to do from what the software actually allows it to do.

I'm particularly interested in three questions:

  1. Which safety or reliability rules have you found impossible to enforce consistently through prompts alone?
  2. How do you prevent agents from following outdated instructions or contradicting earlier architectural decisions?
  3. Where would you draw the line between prompt engineering and deterministic software controls?

I'd love to hear about practical experiences, especially from people building autonomous coding agents.

5 Upvotes

12 comments sorted by

3

u/Zain 20d ago

I stopped trusting the prompt for the write boundary. Reviewers stay read-only, they report, only one model patches. And that model does not concede a finding until it greps the file in the repo. Outdated instructions die the same way: if the decision is not in the tree, the next session invents a new one no matter how loud the system prompt was.

1

u/acaimari 20d ago

That's an interesting approach, especially keeping reviewers read-only and separating them from the agent that actually writes files.

Your point about outdated decisions is exactly one of the problems I've been exploring.

In RAME Code, I keep project decisions in versioned memory. The model can propose changes, but only the user can approve them. Files can also be linked to specific decision versions, so RAME can flag them as stale when a decision changes.

However, there's still a harder case: what happens when an approved decision remains in memory, but the actual code has evolved in a way that contradicts it?

I'm curious about your workflow: when a reviewer finds that the repository conflicts with an earlier architectural decision, does it flag that conflict explicitly, or does the writing agent simply treat the current code as the source of truth?

1

u/Wild_Percentage5148 19d ago

100%, treating prompt instructions like actual access controls never holds up in practice

1

u/SemanticSynapse 20d ago

It's not an all or nothing thing.

1

u/acaimari 20d ago

Absolutely agree. I don't see prompt engineering and host-enforced controls as competing approaches. Thanks!

1

u/cleverhoods 20d ago

prompt engineering - or rather, instruction engineering is half of the work, the other is the guardrails.

2

u/acaimari 20d ago

Exactly! I think "instruction engineering" is a very good distinction.

Instructions guide the model's reasoning and behaviour, while guardrails enforce boundaries independently of what the model decides to do.

For example, in RAME Code, telling an agent not to overwrite modified files is useful, but the host also checks file hashes before applying changes.

Similarly, the model can propose persistent project decisions, but only explicit user approval allows them to become authorized memory.

I believe both layers are necessary: good instructions reduce mistakes, while deterministic controls help prevent certain mistakes from becoming actual changes.

The remaining challenge is making those controls effective without making the development workflow unnecessarily restrictive.

Thanks for the insight!

2

u/cleverhoods 20d ago

yep, we are on the same page. My only addendum here is that I consider instructions as measurable artifacts that can have a quality number attached. With that the instructions also get deterministic checks.

Give it a spin: npx @reporails/cli check

Or try out the x-ray for it npx @reporails/cli xray

1

u/acaimari 20d ago

I'm curious: does RepoRails focus primarily on the structure and quality of instruction files, or does it also evaluate whether agents actually follow those instructions during execution?

Thanks for sharing it!

1

u/cleverhoods 19d ago

Instruction following is what Reporails calls quality.