Skip to content
How it works / Refusals

Refusals

Markdown

Why Atracode refuses code it can't verify exactly, how to read a refusal, the common causes and fixes, and how agents receive them.

Preview. Atracode opens at launch, and the commands, tools and API shapes on this page may change before then.

Atracode is fail-closed. If a program depends on something the compiler can’t model and check bit for bit, it stops and tells you where, instead of producing a graph that might behave differently from your code. A refused compile produces no SEG, no RAVEN hash and no build.

Refusals are how Atracode keeps its guarantee. Every verified result has been checked against the native toolchain over a large input sweep, and that check only means something if the program behaves the same way every time it runs.

Reading a refusal

A refusal names the file, line and column, the reason, and a hint:

refused  rotate.sh:12:9  reads $(date), which differs on every run
  hint: pass the timestamp in as an argument and compile again
  • rotate.sh:12:9 is the exact location of the construct, so your editor can jump to it.
  • The reason says what the code does and why that can’t be verified.
  • The hint says the usual fix.

The compiler reports the first construct it can’t accept. Fix it and compile again, and if there is another, you’ll get the next refusal.

Common causes and fixes

Almost every refusal has the same fix: the value that changes from run to run becomes an input. The program then computes the same thing for the same inputs, which is what Atracode can verify. The caller, whether a shell, a host program or another graph, reads the outside world and passes the value in.

Reading the clock

time.time() in Python, Get-Date in PowerShell, System.currentTimeMillis() in Java and time(NULL) in C all return a different value on every run.

Fix: take the timestamp as an argument or parameter. A log rotation script that names files by date should receive the date from its caller.

Randomness

Calls to a random number generator seeded from the system, such as random.random() with no seed or reading /dev/urandom, can’t be reproduced.

Fix: pass the seed, or the random values themselves, in as inputs. A generator with a seed that comes in as an input is deterministic and compiles.

Environment variables

Reading $HOME, os.environ["REGION"] or getenv("DEBUG") makes the result depend on the machine it runs on.

Fix: pass the value as an argument or configuration input. The closed-world property means a program can only touch what it declares.

Network access

Fetching a URL, opening a socket or querying a remote service depends on something outside the program.

Fix: fetch the data outside the compiled program and pass it in. The compiled part becomes a pure function of that data, which can be verified and hashed.

Unbounded loops and recursion

Every execution runs on a fuel budget, so a loop bounded by its inputs compiles and is capped at run time. A loop or recursion with no bound the compiler can establish, such as a loop that waits for an outside event to end it, is refused.

Fix: bound the loop by an input (a count, a list, a deadline passed in as a value), or move the waiting into the caller and compile the work done on each iteration.

Open-world dynamic constructs

Dynamic languages such as Python, JavaScript, Ruby and PHP compile through bounded adaptation into exact type-specialized dispatch. Most dynamic code compiles this way. A construct that genuinely depends on the outside world, such as loading code by a name read at run time, or running a string built from outside data as code, is refused at its exact location.

Fix: make the set of possibilities closed. Import the modules you need directly, or pick from a fixed table of functions using an input.

How agents receive refusals

Through the MCP server, atracode_compile returns the same refusal as structured data:

{
  "status": "refused",
  "refusal": {
    "file": "rotate.sh",
    "line": 12,
    "column": 9,
    "reason": "reads $(date), which differs on every run",
    "hint": "pass the timestamp in as an argument and compile again"
  }
}

An agent can open the file at that line, apply the hint, and call atracode_compile again until it gets status: "verified" and a raven_hash. Because the refusal is exact, the agent doesn’t have to guess what went wrong.

Next steps

esc

Type to search titles, headings and text.