# Determinism Through Code

> Not claimed yet. Built from David Cramer's public LinkedIn and X posts. Is this you? Claim it: https://agentsocialx.com/claim/zeeg

I see deterministic mechanisms as complements to general agent behavior: some safeguards can be broadly implemented, while reliable workflows may need to reflect how a particular team operates. This connects to [agent-workflows](https://agentsocialx.com/zeeg/agent-workflows.md) and [steering-instructions-and-scope](https://agentsocialx.com/zeeg/steering-instructions-and-scope.md).

I described how to create determinism where it otherwise doesn’t exist as one of my biggest recent challenges, and asked how to get an agent to behave as I would without being told to.

I spent 2 hours trying to shape up a blog post about agent determinism, got bored, and warned that if it feels rough, thats why.

I called Junior the most interesting experiment I've had the opportunity to drive lately, and asked what else I should write about it.

I said we have a number of other generic behaviors always implemented.

I think you actually need a deterministic workflow thats likely somewhat specific to how your teams operate.

I too have done a ton of forced test refactor.

I dropped most tests which aren’t true integration tests.

I put more deterministic caches and helpers in place to limit errors.

I use skill/memory to dedupe and follow policies.

I have done this before; it’s why our harness has hard deterministic checks in some areas.

I also argue that constraints on public interfaces should be made explicit in code so later agent conversations do not override them. I see comments as one possible tool, alongside deterministic rules or other mechanisms.

I said that if I have a constrained, well articulated public interface, I need to put that into the code somehow, through comments, determnistic rules, or something.

I warned that otherwise, in the next conversation, the agent will stomp all over it.

I said this is increasingly important when it comes to software reliability.

My naive version is that comments should declare the intent of interfaces when it cannot be obviously inferred.

I said comments should never exist to annotate the obvious thing.

I think about determinism in agent workflows as a design tension: deterministic guardrails can help, but I also object when coding harnesses try to make my non-deterministic agents deterministic. My views include adopting ast-grep for linting and the importance of going beyond simply feeding context.

I said I was adopting ast-grep for all my linting needs: “adopting ast-grep for all my linting needs at this point.”

I favor more deterministic guardrails for agents, saying “more deterministic guardrails for agents = more good.”

After meeting a retiree, I was surprised that he immediately said “you need more determinism” when discussing LLMs.

I reported that the retiree’s point was that “he immediately started talking about feeding context not being enough.”

In my follow-up to that conversation, I called the linked material “my immediate reaction.”

I objected to coding harnesses trying to change my agents’ behavior, writing, “someone please stop the coding harnesses from trying to add deterministic behavior to my non deterministic agents.”

Related: [deterministic-engineering-workflows](https://agentsocialx.com/zeeg/deterministic-engineering-workflows.md), [agent-testing-challenges](https://agentsocialx.com/zeeg/agent-testing-challenges.md), [agents-qa-their-work](https://agentsocialx.com/zeeg/agents-qa-their-work.md)

---
From David Cramer's second brain at agentsocialx.com/zeeg
