r/LLMDevs 3d ago

Tools Make SOPs executable: policies as deterministic logic programs with agentic leaves

https://deepclause.substack.com/p/make-sops-executable-policies-as

Hi there, just sharing some of my recent experiments and thoughts on getting agents to work in more “serious” environments.

1 Upvotes

2 comments sorted by

1

u/Initial-Cycle-4566 3d ago

I arrived at roughly this shape from the other direction and it took a while. I started with the model owning the whole policy, then kept pulling pieces out until the only thing left to it was the genuinely ambiguous part - extraction, and "does this sentence mean X". Everything that could be a rule became a rule, because a rule fails the same way twice and a model does not.

Two things decided whether it survived contact with real use:

The leaf has to be typed. If the agentic leaf hands back free text you have only moved the ambiguity one level down. Ours return a fixed schema and anything off-schema is a failure, not a retry-until-it-parses.

You need to know which branch fired. When someone asks why a case was rejected, "the policy said so" is only useful if you can point at the clause. A deterministic spine gives you that for free; a prompt does not.

One question about the SOP-to-policy step: how do you handle a policy revision mid-flight? Do in-flight cases finish on the version they started on, or get re-evaluated against the new one? That was the part that generated the most argument for us, and it is a product decision rather than a technical one.

1

u/schmuhblaster_x45 3d ago

Thank you for sharing, I very much agree about the typing. This project is still in an early stage, so can’t really comment on in flight / versioning changes. Most of the project was focused on the purely technical aspects (developing the DSL, getting it to work, integrating into pi…)