SafeExec for Spring Boot

SafeExec prevents AI agents from turning retries, stale approvals, and unsafe tool calls into production incidents.

A production-safe execution harness for Spring Boot. Every tool call an agent proposes passes schema, policy, approval, idempotency and audit before it can touch your systems. Full source. Runs entirely inside your infrastructure.

Get the Launch edition · $49 Read the source (Lite, MIT) Full source delivered September 21, 2026. Full refund anytime before delivery.

Five things that go wrong in production

None of them is a model problem. All of them are what happens when a program that acts on its own meets a real system.

1

The request timed out. Did you just purchase twice?

One external idempotency key per business action, fixed for every attempt. After a timeout the answer is three-state: applied, confirmed not applied, or indeterminate. Only the second one may resend.

2

The user approved $300. The agent changed it to $3,000.

An approval binds to an immutable intent. Parameters, policy facts and evidence values are hashed; a change is a new intent that needs a new approval.

3

The supplier processed the request. Your process crashed before saving the result.

DISPATCHING is committed before the external call. After a restart, a scanner reclaims the stale attempt and reconciles instead of guessing.

4

The agent passed staging tests. Would you let it write to production?

Shadow mode: real decisions on real data, zero side effects, and a measured agreement rate per tool before any permission is released.

5

Something went wrong three days ago. Can you reconstruct exactly what happened?

An append-only audit event stream, enforced by a database trigger, replayable by trace: policy version, rule hit, approval, attempt, external key.

SafeExec for Spring Boot handles all five.

Each one is proved by a fault-injection test against a real PostgreSQL, not described in a document. Network timeout doesn't mean "try again."

Three sentences the whole design is built on

If a test and a document disagree, the test wins.

UNKNOWN ≠ FAILED
NOT_FOUND ≠ CONFIRMED_NOT_EXECUTED
APPROVED ≠ STILL_SAFE_TO_EXECUTE

How it works

The agent proposes. SafeExec decides whether, when and how the proposal becomes an action. Your business tools stay exactly as they are.

AgentLLM via Spring AI, or your own rules
SafeExecSchema · Policy · Approval · Idempotency · Recovery · Shadow · Audit
Business toolsorders, payments, suppliers, tickets
No runtime license server
No telemetry
No vendor cloud dependency
Full source code
Runs inside your infrastructure

No production data, API keys, or agent actions are ever sent to us. There is nothing to opt out of.

What's inside

Java 21 · Spring Boot 3.5 · PostgreSQL 16 · Spring AI 1.1 adapter only (core has no model dependency)

ModuleWhat it guaranteesLite (MIT)Pro
Tool GatewayStrict schema conversion, Bean Validation, one path for every call, sealed resultscore model
Policy EngineFacts not JSON, structured rules, single-action limits, kill switch, fail closed
Intent · Attempt · RecoveryAt-most-once by database constraint, three-state reconcile, bounded retries, crash scanner
Approval · EvidenceEight-step execution-start transaction, re-approval on stale evidence, hash mismatch or tightened policy
AuditPer-stage events committed independently, append-only by trigger, redaction, replaycore model
ShadowDecide without acting, record the human's decision, release per group on a number
Fault-injection suite80+ tests on a real PostgreSQL via Testcontainers, five runnable scenario scripts
Design notesSix pages: what breaks, mechanism, invariants, the tests that prove them

Quick start

git clone <repo> safeexec && cd safeexec
./mvnw -pl safeexec-example-purchase -am spring-boot:run -Dspring-boot.run.profiles=demo
./scripts/scenario-1-timeout-no-double-purchase.sh   # …through scenario-5

The demo agent is rule-based, so nothing needs an API key. Add a Spring AI model starter and a model proposes instead; the gateway treats its output exactly the same way.

Pricing

One-time payment. Source code. Use it in any number of your own projects.

Launch edition
$49 $79
  • Full source of every module above, plus the test suite and design notes
  • Delivered September 21, 2026 as a zip with SHA-256, plus read access to the private update repository
  • 12 months of updates
  • Full refund anytime before delivery. After delivery: refund if it cannot run as described in the README and we cannot resolve it within 7 days.
Get the Launch edition · $49

$79 after delivery. Payments handled by Creem; we never see your card.

Who it is for

Java backend engineers who have to put an agent in front of orders, payments, refunds or customer messages, and teams delivering agent projects to clients who will ask "what happens when it times out?"

License in one paragraph

Use and modify the source in any number of projects you own or control, including client work you deliver as applications. Do not publish the source, resell it as a starter, or hand it to a third party as a source package. Full text.

The Lite edition (core domain model and design notes) is MIT-licensed and free on GitHub.

FAQ

Which model providers does it work with?

Any. safeexec-core has no dependency on any model or on Spring AI. The optional adapter uses Spring AI 1.1's ChatClient, so anything Spring AI supports works; a rule-based planner is included and needs no key at all.

Does it phone home, check a license, or need your cloud?

No, no, and no. There is no telemetry code path and no runtime license check; the license file in the zip is informational. Your database, your network, your data.

Why PostgreSQL?

Because the guarantees are enforced by the database: a compare-and-set for at-most-once, a partial unique index for one live attempt, triggers for immutable intents and append-only audit, FOR UPDATE SKIP LOCKED for the recovery scanner. In-memory databases would prove nothing.

Is this an agent framework?

No. It does not plan, orchestrate or manage prompts. It sits between whatever plans and whatever has side effects. Keep your framework.

What is not in 0.1?

Daily quotas (they need reservations; planned), a runnable Lite gateway subset (planned), LangChain4j adapter (after the first sale).

Security disclosures

Email security@autorun.fun. Please do not open a public issue. See SECURITY.md in the repository for the threat model.