Skip to main content

Fettle

The open-source trust layer for AI coding agents

Catch mistakes while the agent still has context. Prove what passed before the change ships.

PyPI CI Python 3.11+ Apache 2.0 license

Quick start · Why Fettle · Install · Capabilities · Docs

pipx install finefettle
fettle demo

One command installs Fettle's complete Python-backed toolkit: Ruff, Semgrep, pytest, mutmut, PyYAML, Playwright's Python library, bundled rules, workflows, schemas, demo fixtures, and agent-host bridges. No API key, hosted control plane, or repository is needed for the demo. Python 3.11+ and Git are prerequisites.

fettle (v.) - a foundry term for trimming and cleaning a rough casting.

Why Fettle

AI coding agents changed the unit of software work. It is no longer only a diff; it is a chain of authority, edits, delegated workers, tests, exceptions, and remote verdicts. Most tools inspect one link after the agent has moved on. Fettle governs the chain while preserving CI as the independent boundary.

intent -> authority -> action -> evidence -> independent verification
                    Fettle trust boundary

Fettle is unusual because these controls live in one local, inspectable system:

Strength Why it matters
In-session feedback Findings reach the agent while it still understands the code and can repair it.
Evidence-bound decisions Verification and assurance bind verdicts to source, policy, scope, producer, and execution instead of trusting free-floating JSON.
Fail-visible semantics Missing tools, stale artifacts, malformed reports, timeouts, and crashes remain non-pass outcomes.
Delegation-safe policy Digest-checked capsules carry policy and lineage to child agents; delegated work may tighten constraints, not silently loosen them.
Host-neutral governance Claude Code, Codex CLI, Gemini CLI, and OpenCode share one normalized dispatcher and .fettle.toml policy.
Local-first operation Core governance runs in your environment without sending source or hidden reasoning to a Fettle service.
Measured promotion Rules and gates begin advisory and move toward enforcement from retained evidence, not confidence alone.

Fettle does not replace tests, code review, CI, an agent orchestrator, or a sandbox. It connects them into a control loop and makes unsupported trust visible.

Try It in Two Minutes

pipx install finefettle
fettle demo

The deterministic offline demo introduces a broad exception handler, detects it, applies the repair, and independently reruns four tests:

[1/4] VIOLATION INTRODUCED  demo_project/calculator.py:4
[2/4] VIOLATION DETECTED    broad-except-no-reraise
[3/4] REPAIR APPLIED        Exception -> ValueError
[4/4] REPAIR VERIFIED       Re-ran check: clean; re-ran tests: 4 passed

The checked-in assurance loop contains the fixtures, complete transcript, reset path, and drift test.

To use Fettle in a repository:

cd your-project
fettle init --dry-run
fettle init --profile solo       # solo | team | enterprise
fettle doctor
fettle check --changed
fettle verify
fettle assurance

fettle init --dry-run shows every proposed change. fettle doctor reports which capabilities are available or degraded. Start advisory; enforce only after you have measured signal and tested recovery in your own workflow.

One Package, the Complete Python Toolkit

The PyPI project is finefettle; the installed command is fettle.

pipx install finefettle
# or
uv tool install finefettle

The default wheel declares and installs every Python runtime Fettle invokes and contains its runtime resources. Release CI installs the exact wheel with both pip and pipx, runs the demo outside the checkout, verifies bundled resources and executables, rebuilds from the source distribution, generates a CycloneDX SBOM, and publishes provenance attestations.

A Python package cannot safely embed system-owned runtimes. Install Git first; add browser binaries (playwright install), agent CLIs, language toolchains, or external services only for the surfaces you use. fettle doctor reports these boundaries rather than pretending an unavailable capability passed. See the installation guide.

The Trust Loop

  1. Observe early. Hooks normalize agent events and route changed files to configured checks.
  2. Return actionable findings. The agent sees location, reason, and recovery while its working context is intact.
  3. Verify independently. fettle verify runs repository tests and binds the result to the exact source and policy.
  4. Assess the whole change. fettle assurance evaluates nine dimensions and explains every pass, failure, and unknown.
  5. Retain evidence. Canonical artifacts, remote CI, mutation reports, UAT, and the governance ledger preserve what actually happened.
Assurance Record c04c9a206c05 · PARTIAL · commit 25f4957
  PASS     behavior
  PASS     provenance
  UNKNOWN  security      raw review is not canonical evidence
  UNKNOWN  independence  no retained role-bound authorship decisions

Missing evidence does not become success. Failed assessment or persistence also invalidates an older assurance record so stale approval cannot look current.

Capabilities

Area Shipped capability Boundary
Agent lifecycle Claude Code, Codex CLI, and OpenCode live-verified; Gemini CLI contract-tested Host enforcement differs and fettle doctor reports it
Quality Ruff, bundled Semgrep rules, baselines, suppressions, noise budgets, dependency and boundary checks fettle check is Python plus language-neutral Semgrep; post-edit routing is broader
Polyglot workspaces Python, JavaScript/TypeScript, Go, and Rust post-edit and verification routing Native toolchains remain external
Verification Test execution with canonical source, policy, scope, producer, and occurrence bindings Local evidence does not replace remote CI
Assurance Nine-dimension canonical Assurance Record and frozen baseline comparison tooling Graduation of stronger security enforcement still requires real shadow evidence
Mutation quality Python preflight, changed/full execution, replay, stable fingerprints, accepted baselines, survivor enforcement Python and pinned mutmut==2.5.1 only
Delegated work Plans, worktrees, claims, topology, role-aware spawn, policy capsules, lineage, completion reports Defense in depth, not OS isolation
Specifications Markdown specs, lint, scenario inventory, trace coverage, and canonical drift evidence Declared links count only when execution evidence passes
User acceptance CLI, API, web, and library sessions; manual walkthroughs; artifact-bound verdicts; seeded benchmark Report-only unless separately promoted by policy
Change intelligence Deterministic source snapshots and advisory graph status, impact, and shadow Graph results are advisory
State consistency Contract templates, lint, listing, and execution across modeled views Contract-specific adapters define observable reach
Operations Digest-pinned central policy, telemetry controls, integrations, compliance/lineage reports, tamper-evident ledger External services are opt-in
Guided workflows 17 packaged workflows for quality, security, planning, review, and governance Workflows guide reasoning; CLI behavior stays deterministic

See the detailed capability matrix and task-oriented documentation.

Built for Real Failure Modes

Fettle distinguishes pass, violation, tool_error, unknown, and explicit non-applicable states. Its regression suite pins adversarial cases including forged verification stamps, deleted canonical references, stale CI evidence, tampered policy capsules, crashed analyzers, unsafe agent-runner flags, and incomplete mutation shards.

Selected high-risk protocols also have TLA+ models. Releases use PyPI Trusted Publishing, SHA-pinned GitHub Actions, build provenance attestations, public-wheel canaries, and an attached SBOM.

Common Journeys

Add Agent Governance

fettle init --profile team
fettle doctor
fettle workflows list
fettle explain

Coordinate Delegated Work

fettle plan start --title "Add export" --item "Write contract test"
fettle topology advise
fettle spawn claude --role tester --task "Write the failing tests"
fettle brief --json

Build Trust Evidence

fettle verify
fettle ci status
fettle mutation preflight --all --json
fettle assurance
fettle ledger status

Connect Requirements to Outcomes

fettle spec lint
fettle spec coverage
fettle uat doctor
fettle uat manual
fettle consistency lint

Honest Boundaries

  • Hooks optimize feedback speed; protected CI remains the independent authority.
  • Capsules, claims, shell mediation, and role gates are not a security sandbox.
  • Python has the richest analyzer, mutation, and editor support.
  • Browser engines, agent CLIs, external services, and non-Python toolchains are intentionally not bundled into the Python environment.
  • Graph intelligence is advisory. UAT and stronger assurance policies graduate only from retained evidence and explicit operator decisions.
  • Fettle records decisions and observable evidence, not hidden chain-of-thought.

Documentation

Goal Guide
Install, upgrade, or remove Fettle Installation
Pick the right command Documentation index
Compare supported surfaces Capability matrix
Configure gates and policy Configuration
Govern multiple agents Multi-agent guide
Connect OpenCode OpenCode integration
Run mutation evidence safely Mutation playbook
Understand evidence identity Evidence contract
Review shipped and planned work Roadmap
Contribute Contributing
Report a vulnerability Security

Contributing

Contributions are welcome. Fettle favors focused changes, explicit failure states, clean and violating fixtures, and verification proportional to risk. Start with CONTRIBUTING.md or a good first issue.

License

Fettle v1.12.1 and later are licensed under the Apache License 2.0. Earlier releases retain their published MIT license. See TRADEMARK.md for permitted use of the Fettle name and logos.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

finefettle-1.13.1.tar.gz (838.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

finefettle-1.13.1-py3-none-any.whl (570.3 kB view details)

Uploaded Python 3

File details

Details for the file finefettle-1.13.1.tar.gz.

File metadata

  • Download URL: finefettle-1.13.1.tar.gz
  • Upload date:
  • Size: 838.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for finefettle-1.13.1.tar.gz
Algorithm Hash digest
SHA256 0ff17977c9c82d0b951aadf7ef42ea1e35454ddbef0deb781505e8054d006529
MD5 1e3fefd956c2c790a769088a352bf343
BLAKE2b-256 5e05b4976a98a4a08d1ea25ff3c175251a91c78598804215103c33decd58751e

See more details on using hashes here.

Provenance

The following attestation bundles were made for finefettle-1.13.1.tar.gz:

Publisher: release.yml on MilindGaharwar/fettle

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file finefettle-1.13.1-py3-none-any.whl.

File metadata

  • Download URL: finefettle-1.13.1-py3-none-any.whl
  • Upload date:
  • Size: 570.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for finefettle-1.13.1-py3-none-any.whl
Algorithm Hash digest
SHA256 64876ed1a51c90bfa25c99e91fa91ded55aa1c9a834f5080383279845ce91945
MD5 dcb7e4d434deda0debbd817d60889765
BLAKE2b-256 4603c70fdf2f6fc325c2a559693e0b8bd859e41d9f3f9c20e39ff467696a2664

See more details on using hashes here.

Provenance

The following attestation bundles were made for finefettle-1.13.1-py3-none-any.whl:

Publisher: release.yml on MilindGaharwar/fettle

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

This release

1.13.1 This release

2 files

1.13.0

2 files

1.12.3

2 files

1.12.1

2 files

1.12.0

2 files

1.11.1

2 files

1.11.0

2 files

1.10.0

2 files

1.9.0

2 files

1.8.0

2 files

1.7.0

2 files

1.6.0

2 files

1.3.1

2 files

1.3.0

2 files

1.2.0

2 files

1.0.2

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page