# what is the bernstein autofix daemon

Canonical URL: https://bernstein.run/q/what-is-the-bernstein-autofix-daemon
Markdown URL: https://bernstein.run/q/what-is-the-bernstein-autofix-daemon.md
Tags: autofix, ci

bernstein autofix watches prs opened by bernstein for ci failures. on red ci it pulls the failing job's logs, parses them via src/bernstein/adapters/ci/, spawns an agent against the worktree that opened the pr, gives it the failure trace as context, and pushes a fix commit to the same pr branch. the daemon respects the same budget, audit, and policy gates as a normal bernstein run; it does not bypass approval if approval is required for the touched paths. typical use: the operator goes to sleep, bernstein opens 3 prs overnight, autofix patches the two that go red so the morning queue has 3 green prs ready to review.

## Related

- https://bernstein.run/q/can-bernstein-run-in-ci
- https://bernstein.run/q/how-to-run-bernstein-in-github-actions
