AVCEL Engineering · Research

Coding agents ship the feature. They miss the policy.

We gave a coding agent 85 realistic tickets on two open-source codebases. Each change was governed by written company policy that the ticket never mentioned. Left alone, the agent almost never followed it. With AVCEL, it followed it most of the time, and for less.

72% vs 13%
of changes followed company policy with AVCEL, against an agent given no help
75% vs 63%
AVCEL against a careful team's hand-written instruction file, on new tasks
4.7× lower
model cost per policy-compliant change than no help ($0.27 vs $1.26)
92% vs 42%
of policy exceptions handled correctly, against the instruction file

What is a company policy?

A company policy is a business rule the company's software must obey. It is written by compliance, risk, operations or legal, not by engineers, and it lives in handbooks, circulars and memos, not in the code or the ticket.

Two examples from the bank in our study. Each shows the policy in the document's own words, and what it means for the code.

Example 1Approval Bank
No user, of any role (including administrators and system or super users), may approve their own action or skip approval.
In the code: approving must fail when the approver is the person who made the change, even for an admin.
Example 2Exception Bank
A fee or penalty waiver made under an active hardship plan needs no checker, but it must reference the plan.
In the code: don't send these to a second approver; do require the plan reference.

Policy also changes, and documents disagree. After an amendment, the bank's no-checker limit drops from 100 to 50, and the insurer's deadline for late claims from 60 to 45 days. The old limit still governs older loans and claims, so the right answer depends on the date. A desk memo that says a team lead alone may approve short payment pauses contradicts the handbook, and the handbook wins.

The bank and insurer are fictional, and their policy was written for this study the way real policy is written. Each company has 12 documents.

The problem: policy lives outside the ticket

A ticket says what to build. It almost never says which policy applies. A developer who hasn't read the policy can write a change that works, passes review, and still breaks it. A coding agent is that developer, on every ticket.

One ticket, two runs

A real ticket from our insurance task set: "Let reviewers fix the justification of a claim line." The ticket says nothing about policy. The insurer's internal controls do:

"An override of approved quantity or price must carry a non-empty justification … This applies to every user, of any role, including administrators."Internal controls, Kestrel Mutual Health Fund (fictional insurer)
Coding agent alone
Never opened the policy folder. Added the feature and its tests, then reported "done".
Feature tests7 / 7
Policy tests0 / 7
Coding agent + AVCEL
Received the two policies for this change, built them in, and reported "done".
ICS-4.1ICS-4.3
Feature tests7 / 7
Policy tests7 / 7

Same agent (Claude Code, Sonnet 5.5), same ticket, same codebase. Tests were hidden from the agent. Both repeats of each setup ended the same way.

Both runs said "done". Only one is safe to merge, and nothing in the feature tests tells them apart.

How AVCEL works

AVCEL turns a company's policy into something a coding agent can act on, without a developer having to find it, read it or paste it in.

Company documents + codeHandbooks, circulars, procedures, product decisions and the codebase
→
AVCEL BlueprintBuilt once, approved by policy owners. Every policy keeps its limits, dates, versions and exceptions.
→
Coding agentGets the policies that apply to this change, before it writes code
  1. Build once. AVCEL reads the company's documents and the codebase and builds a Blueprint: every policy, linked to the code it governs. Policy owners review and approve it, so the agent works from what the company signed off, not from a guess.
  2. Deliver per change. When a developer gives a coding agent a task, AVCEL hands the agent only the policies that apply to that change, including the exceptions, the old version that still governs older records, and which document wins when two disagree.
  3. Check before saving. Where a policy can be checked in code, AVCEL also checks each edit before it is written and tells the agent what to fix.

The Blueprint is built once per codebase and used on the developer's machine. AVCEL's server does not need to receive the developer's task, conversation or code. It works with the coding agent the team already uses. The results below measure the delivery step alone.

How we tested

  1. Two real codebases. Apache Fineract, an open-source core-banking system (848,000 lines of Java), and openIMIS, an open-source health-insurance system (Python, Django).
  2. A full policy library for each. Twelve documents per company, written the way real ones are: the current handbook, the old version that still governs older loans and claims, an amendment that tightens limits, a desk memo that contradicts the handbook and must lose, and eight other company policies.
  3. 85 tickets that never mention the policy. Each is a realistic request from someone in the business. Most put a policy at stake; some test an exception that must still be allowed; some have no policy at stake at all.
  4. Hidden tests. Every ticket has feature tests and policy tests the agent never sees. A change counts as compliant only if it passes every one of both.

We compared three setups, all with Claude Code on Sonnet 5.5 in a fresh, offline sandbox:

SetupWhat the agent gets
No helpThe policy documents are available, but nobody points the agent to them.
Instruction fileWhat a careful team does today: the repository's CLAUDE.md and AGENTS.md tell the agent where the policy is and to follow it.
AVCELThe policies that apply to this change, from the AVCEL Blueprint, in the agent's first message.

In total: 85 tasks, sealed by hash after an independent review, and more than 3,800 agent runs. 49 of the tasks were built after AVCEL was frozen and never used to shape it.

Results

Left alone, agents almost never read the policy
Share of changes that pass every feature and policy test · 36 tasks
No help
13%
AVCEL
72%

The policy sat one folder away from the code. With no pointer, the agent opened it in 3 of 225 runs.

Agents do what the ticket asks. If the policy isn't in front of them, it doesn't exist. Supplying it moves compliance from 13% to 72%.

AVCEL beats a careful team's instruction file, in both codebases
Share of compliant changes · 28 new policy tasks, 3 runs each, built after AVCEL was frozen
AVCELInstruction file
50%
100%
72%
61%
77%
65%
75%
63%
Banking
Insurance
Overall

+12 points overall (95% CI +4 to +20). Features still worked in 97% of AVCEL runs and 93% of instruction-file runs. Every exception and no-policy task stayed correct with AVCEL.

This is the comparison that matters. "No help" is a low bar; a team that has written an instruction file is not. On tasks it had never seen, AVCEL still produced more compliant changes than the best manual setup, in both banking and insurance.

The reason is what each one gives the agent. An instruction file points to the whole policy folder, the same way for every change, and leaves the agent to work out which parts apply. AVCEL gives it only the policies that govern this change, with their exceptions and the version in force.

Following policy costs less, not more
Model cost per compliant change: total cost of all runs ÷ compliant changes. Lower is better.
New tasks
Instruction file
$0.37
AVCEL
$0.26
Original tasks
No help
$1.26
Instruction file
$0.27
AVCEL
$0.27

Model cost at list price. AVCEL was never more expensive per compliant change than any other setup.

A cheap run that breaks policy is wasted spend. An agent that gets the right policy up front also skips searching through the whole policy folder: 9.2 turns per run with AVCEL against 12.1 with the instruction file on the banking codebase.

AVCEL also knows when a policy doesn't apply
Exception tasks: the policy allows the change, and it must not be blocked · 3 tasks, 4 runs each
AVCEL · 11 of 12 correct
Instruction file · 5 of 12 correct
Handled correctlyBlocked work the policy allows

Enforcing too much is its own failure. The bank's handbook says: "A fee or penalty waiver made under an active hardship plan needs no checker, but it must reference the plan." Told to follow the whole handbook, the agent sent those waivers to a checker anyway in 7 of 12 runs. AVCEL delivers each policy with its exceptions, so the agent blocked allowed work only once.

Limits and what's next

Method details
Task setTasksPolicy at stakeExceptionNo policy
Banking, original181314
Insurance, original181224
Banking, new211236
Insurance, new281648
Total85531022
  • Agent: Claude Code, headless, Sonnet 5.5. Fresh container per run, no internet except the model API. Limit of 100 turns and 60 minutes per run.
  • Scoring: a run is compliant only if it passes every hidden feature test and every hidden policy test. Crashes and time-outs count as failures.
  • Tasks: each ships with a reference patch that passes everything and a violating patch, the change a careful developer would write without the handbook, which passes every feature test and fails at least one policy test. Every task was checked by an independent reviewer and sealed by hash.
  • Intervals: 95% confidence intervals are bootstrapped over tasks.
  • Codebases: Apache Fineract 1.15.0 (Java 21) and openIMIS v1.11.0 claims module (Python 3.11, Django 4.2), at pinned versions.