Sections
Set up Dawnfix
Dawnfix is an AI SRE that runs in your own GitHub Actions. Setup is npx dawnfix init, which writes two files in your repo, then one read-only cloud role and two repo settings. Everything is free and source available. No key is needed.
What you need
- A GitHub repo whose production runs on AWS (CloudWatch Logs, alarms, ALB) or GCP (Cloud Logging).
- Node 20 or later, for
npx. TheghCLI signed in, and the AWS CLI orgcloudwith rights to create one role. - Your own AI API key (Claude today). It is stored as a GitHub Actions secret in your repo and never sent to us.
Platforms
Dawnfix runs in GitHub Actions on GitHub repos, and as dawnfix run jobs in GitLab CI and Bitbucket Pipelines.
- GitLab: GitLab CI, merge requests and issues.
- Bitbucket: Bitbucket Pipelines and pull requests. Bitbucket Cloud: diagnose only; fixes on self-hosted runners.
- CircleCI Not available yet
Steps
- Run
npx dawnfix initat the root of your repo. It asks where your logs are, shows the two files in full and writes them when you say yes. It never asks for a secret. Add--dry-runto only see them.npx dawnfix init.dawnfix.ymlsays what to watch and what Dawnfix may do. Start withautonomy: diagnose;test.commandis the one command the fix agent may run later.templates/dawnfix.ymlin the public repo lists every key..github/workflows/dawnfix.ymlis about 15 lines. It calls the reusable workflow of the release, which holds the jobs, their permissions and the agent's instructions:# Dawnfix (https://github.com/dawnfix/dawnfix), written by `npx dawnfix init`. The jobs are in the # reusable workflow below; each asks for less than the permissions granted here. name: dawnfix on: schedule: [{ cron: "17 * * * *" }] # the `schedule` of .dawnfix.yml workflow_dispatch: { inputs: { baseline: { type: boolean }, dry_run: { type: boolean } } } permissions: { contents: write, pull-requests: write, issues: write, id-token: write } jobs: dawnfix: uses: dawnfix/dawnfix/.github/workflows/dawnfix.yml@v0 with: aws-role-arn: ${{ vars.DAWNFIX_AWS_ROLE_ARN }} secrets: DAWNFIX_AI_API_KEY: ${{ secrets.DAWNFIX_AI_API_KEY }} # your AI API key (Claude today) DAWNFIX_ENTERPRISE_KEY: ${{ secrets.DAWNFIX_ENTERPRISE_KEY }} # optional@v0follows the v0.x releases. Pin@v0.5.0or a commit SHA instead to freeze it; a commit SHA is the auditable choice. Its cron must equal theschedulein.dawnfix.yml. Want the whole workflow in your repo instead? Copytemplates/github/workflows/dawnfix.yml: the same jobs, reading repo variables instead of inputs. - Deploy the read-only cloud role.
initprints these commands with your repo's names filled in. On AWS, deploy the CloudFormation templateinfra/aws/dawnfix-read-role.yaml, then check it cannot write:curl -fsSLO https://raw.githubusercontent.com/dawnfix/dawnfix/v0.5.0/infra/aws/dawnfix-read-role.yaml aws cloudformation deploy \ --template-file dawnfix-read-role.yaml \ --stack-name dawnfix-read-my-app \ --capabilities CAPABILITY_NAMED_IAM \ --parameter-overrides GitHubOrg=example-org GitHubRepo=my-app Branch=main \ CreateOIDCProvider=true RoleName=dawnfix-read-my-app LogGroupPrefix='*' curl -fsSLO https://raw.githubusercontent.com/dawnfix/dawnfix/v0.5.0/infra/aws/verify_readonly.py python verify_readonly.py arn:aws:iam::123456789012:role/dawnfix-read-my-app \ --log-group my-api-prod --region us-east-1verify_readonly.pyneeds Python withboto3, which the CLI install below brings. On GCP, runinfra/gcp/setup-wif.sh. It lets the workflow of this one repo read Cloud Logging in one project through workload identity federation, withroles/logging.viewerand no key file:curl -fsSLO https://raw.githubusercontent.com/dawnfix/dawnfix/v0.5.0/infra/gcp/setup-wif.sh bash setup-wif.sh --branch main my-project-id example-org/my-app - Set two repo settings. A variable and a secret, by name. You type the values; they never pass through anyone else:
Optional, Enterprise only:gh variable set DAWNFIX_AWS_ROLE_ARN # or DAWNFIX_GCP_WIF_PROVIDER gh secret set DAWNFIX_AI_API_KEY # your AI API key (Claude today)gh secret set DAWNFIX_ENTERPRISE_KEY. Without it, nothing is sent anywhere and everything else works the same: each hosted step only prints a line saying it needs an Enterprise key. - Merge, then run it once. Open a PR with both files and merge it. Then check what would leave your account, and record the errors you already have so only new ones are reported.
npx dawnfix doctorchecks the setup:gh workflow run dawnfix.yml -f dry_run=true gh workflow run dawnfix.yml -f baseline=true npx dawnfix doctor - Later, let it write fixes. After a week of issues you trust, switch
autonomytodraft-prthrough a PR. For PRs that trigger your CI, use your own GitHub App or a fine-grained token as the PR author.
GitLab CI
On GitLab, Dawnfix runs as four jobs in your project's pipeline. Each job is a fresh container that holds one secret, so no job ever holds two:
dawnfix-readholds the cloud OIDC token only (id_tokens:). Reads your logs with the read-only role. Deterministic, no AI.dawnfix-agentholds DAWNFIX_AI_API_KEY only. Runs the agent. It runs no git and has no repo token. Its only output is an artifact with the changed files and the issue texts.dawnfix-publishholds DAWNFIX_HOST_TOKEN only. Checks those files again in a fresh checkout: no .git, no CI config, no symlinks, submodules or binaries, a credential scan of every changed file. Then it opens a draft merge request or an issue. It never merges.dawnfix-reportholds DAWNFIX_ENTERPRISE_KEY only, optional. Sends counts to the hosted service, only with an Enterprise key.
Shared runners on gitlab.com work. The agent's sandbox starts there, and the agent job is also isolated by being its own job.
The agent job never clones the repository: it gets a copy of the commit without .git, and the CI job token and every CI password are unset before the agent runs. Turn on the runner feature flag FF_GIT_URLS_WITHOUT_TOKENS, and limit the project's job token (Settings > CI/CD > Job token permissions).
Dawnfix branches are pushed with -o ci.skip, so no pipeline runs on them by itself. The merge request's pipeline runs when a person runs it or pushes to the branch, or when your config has merge request pipelines. Dawnfix never changes CI config, including files your .gitlab-ci.yml includes with include: local.
- Run
npx dawnfix init --host gitlabat the root of your project. It writes.dawnfix.ymland shows the include for your.gitlab-ci.yml. It never asks for a secret. Issues go to your project's own issues (report: issues: host). - Include the template at the release tag. GitLab checks the file against the
integrityhash before it runs it:
Theinclude: - remote: https://raw.githubusercontent.com/dawnfix/dawnfix/v0.5.0/templates/gitlab/dawnfix.gitlab-ci.yml integrity: sha256-…sha256-…value is the hash of that exact file. The header oftemplates/gitlab/dawnfix.gitlab-ci.ymlsays how to get it; this computes it:curl -fsSL https://raw.githubusercontent.com/dawnfix/dawnfix/v0.5.0/templates/gitlab/dawnfix.gitlab-ci.yml \ | openssl dgst -sha256 -binary | openssl base64 -A - Deploy the read-only cloud role. It trusts GitLab's OIDC tokens for your project's default branch only. On AWS, deploy
infra/aws/dawnfix-read-role-gitlab.yamland use itsRoleArnoutput:
On a self-managed GitLab, addcurl -fsSLO https://raw.githubusercontent.com/dawnfix/dawnfix/v0.5.0/infra/aws/dawnfix-read-role-gitlab.yaml aws cloudformation deploy \ --template-file dawnfix-read-role-gitlab.yaml \ --stack-name dawnfix-read-my-app \ --capabilities CAPABILITY_NAMED_IAM \ --parameter-overrides ProjectPath=example-group/my-app Branch=main \ CreateOIDCProvider=true RoleName=dawnfix-read-my-app LogGroupPrefix='*'GitLabUrl=https://gitlab.example.com. On GCP, runinfra/gcp/setup-wif-gitlab.sh. It prints the provider name to set asDAWNFIX_GCP_WIF_PROVIDER:curl -fsSLO https://raw.githubusercontent.com/dawnfix/dawnfix/v0.5.0/infra/gcp/setup-wif-gitlab.sh bash setup-wif-gitlab.sh --branch main my-project-id example-group/my-app - Set the CI/CD variables in Settings > CI/CD > Variables, or with
glab. Each secret is masked, protected and scoped to one environment, so only its own job gets it:Not secret, no scope:Variable Environment scope What DAWNFIX_AI_API_KEYdawnfix-agentyour AI API key (Claude today) DAWNFIX_HOST_TOKENdawnfix-publisha project access token: role Developer, scopes api and write_repository DAWNFIX_ENTERPRISE_KEYdawnfix-reportoptional, Enterprise only DAWNFIX_AWS_ROLE_ARNandDAWNFIX_AWS_REGION, orDAWNFIX_GCP_WIF_PROVIDER. Optional:DAWNFIX_AUTONOMY,DAWNFIX_AI_MODEL,DAWNFIX_INSTALL_COMMAND. Without--value,glabreads the value from stdin, so it stays out of your shell history:glab variable set DAWNFIX_AI_API_KEY --masked --protected --scope dawnfix-agent glab variable set DAWNFIX_HOST_TOKEN --masked --protected --scope dawnfix-publish glab variable set DAWNFIX_ENTERPRISE_KEY --masked --protected --scope dawnfix-report # optional glab variable set DAWNFIX_AWS_ROLE_ARN --value "<role arn>" # or DAWNFIX_GCP_WIF_PROVIDER glab variable set DAWNFIX_AWS_REGION --value us-east-1 - Add the schedule. A pipeline schedule on the default branch with
DAWNFIX_RUN=true. The jobs run only whenDAWNFIX_RUNistrue, so your other pipelines are untouched:
To run it once by hand: Build > Pipelines > Run pipeline, with# new projects block pipeline variables; the schedule needs DAWNFIX_RUN (or: Settings > CI/CD > Variables) glab api --method PUT "projects/:fullpath" --field ci_pipeline_variables_minimum_override_role=maintainer glab schedule create --cron "17 * * * *" --ref main --description dawnfix --variable "DAWNFIX_RUN:true"DAWNFIX_RUN=trueandDAWNFIX_DRY_RUN=truefor a dry run, orDAWNFIX_BASELINE=trueto record the errors you already have.
Bitbucket Pipelines
On Bitbucket Cloud, Dawnfix runs in diagnose mode only. It reads your logs and files an issue. With the repository's issue tracker off, it writes the analysis to the publish step's log instead. It does not change code there.
Why: every Pipelines step can push to your repository through Bitbucket's git proxy, with the pipeline's own credential. Claude Code's sandbox would keep the agent off that proxy, but it cannot start in Bitbucket Cloud's step containers. So npx dawnfix init --host bitbucket writes a diagnose config, and the agent step refuses the fix modes (plan, draft-pr) wherever the sandbox cannot start.
Fix modes need a self-hosted runner where the sandbox can start: a Linux runner (the Linux Shell runner, or the Docker runner with a seccomp and AppArmor profile that allows it) where bwrap can create user and network namespaces (kernel unprivileged user namespaces on), with bubblewrap, socat, Node 20 or later and Python 3.11 or later.
Required on every Bitbucket repository: a push restriction on every branch that lets only the account behind DAWNFIX_HOST_TOKEN push. Set it with your own admin token in BITBUCKET_TOKEN:
curl -sS -X POST -H "Authorization: Bearer $BITBUCKET_TOKEN" -H 'Content-Type: application/json' \
https://api.bitbucket.org/2.0/repositories/<workspace>/<repo>/branch-restrictions \
-d '{"kind":"push","branch_match_kind":"glob","pattern":"*","users":[{"uuid":"{<account UUID>}"}],"groups":[]}'
Or in Repository settings > Branch restrictions > Add: pattern *, write access only for that account. npx dawnfix doctor fails without it (with BITBUCKET_TOKEN set, it checks it).
Tags: Bitbucket Cloud cannot restrict who pushes tags (a push restriction on refs/tags/* did not stop one). A tag pushed through the git proxy can carry a new commit whose bitbucket-pipelines.yml runs a tag pipeline with your deployment secrets. In diagnose mode the agent runs no command, so it cannot push anything. That is why Bitbucket Cloud is diagnose only.
Dawnfix runs as a custom pipeline, dawnfix, with four steps. Each step is a fresh container that holds one secret at most, so no step ever holds two:
dawnfix readholds the cloud OIDC token only (oidc: true). Reads your logs with the read-only role. Deterministic, no AI.dawnfix agentholds DAWNFIX_AI_API_KEY only. Runs the agent. It has no clone, runs no git and has no repo token. Its only output is an artifact with the issue texts (and, on a self-hosted runner in a fix mode, the changed files).dawnfix publishholds DAWNFIX_HOST_TOKEN only. Files the issue. In a fix mode it checks the changed files again in a fresh clone (no .git, no CI config, no symlinks, submodules or binaries, a credential scan of every changed file), pushes with [skip ci] and opens a draft pull request. It never merges.dawnfix reportholds DAWNFIX_ENTERPRISE_KEY only, optional. Sends counts to the hosted service, only with an Enterprise key.
The agent step has no clone (clone: enabled: false): it gets a copy of the commit without .git. Every Bitbucket token and every variable named like a secret is unset before the agent runs, and the agent refuses to start if one is left.
In a fix mode on a self-hosted runner, Dawnfix branches are pushed with [skip ci] in each commit message, so no pipeline runs on them by itself. Dawnfix never changes CI config: bitbucket-pipelines.yml and anything under .bitbucket/ are refused.
Issues: only when the repository's issue tracker is on. With it off, the text Dawnfix would file goes to the publish step's log and its artifact.
- Run
npx dawnfix init --host bitbucketat the root of your repository. It writes.dawnfix.yml(diagnose mode) and the pipeline (or the lines to merge into yourbitbucket-pipelines.yml), and prints the push restriction, variables, deployments and schedule to set. It never asks for a secret. The pipeline istemplates/bitbucket/bitbucket-pipelines.ymlat the release tag. - Turn Pipelines on in Repository settings > Pipelines > Settings.
- Deploy the read-only cloud role. It trusts your workspace's OIDC issuer,
api.bitbucket.org/2.0/workspaces/<workspace>/pipelines-config/identity/oidc, with the audienceari:cloud:bitbucket::workspace/<workspace UUID>, and only tokens whose subject is your repository's UUID. Both UUIDs are in Repository settings > Pipelines > OpenID Connect. On AWS, deployinfra/aws/dawnfix-read-role-bitbucket.yamland use itsRoleArnoutput:
On GCP, runcurl -fsSLO https://raw.githubusercontent.com/dawnfix/dawnfix/v0.5.0/infra/aws/dawnfix-read-role-bitbucket.yaml aws cloudformation deploy \ --template-file dawnfix-read-role-bitbucket.yaml \ --stack-name dawnfix-read-my-app \ --capabilities CAPABILITY_NAMED_IAM \ --parameter-overrides Workspace=example-workspace \ WorkspaceUuid=<workspace-uuid> RepositoryUuid='{<repository-uuid>}' \ CreateOIDCProvider=true RoleName=dawnfix-read-my-app LogGroupPrefix='*'infra/gcp/setup-wif-bitbucket.sh. It prints the provider name to set asDAWNFIX_GCP_WIF_PROVIDER:curl -fsSLO https://raw.githubusercontent.com/dawnfix/dawnfix/v0.5.0/infra/gcp/setup-wif-bitbucket.sh bash setup-wif-bitbucket.sh --branch main example-workspace '<workspace-uuid>' '{<repository-uuid>}' my-project-id - Add the deployment environments and their secrets in Repository settings > Deployments. Each secret is a secured variable of one environment, so only its own step gets it:
Never put a secret in repository or workspace variables: those reach every step. Repository variables, not secret:
Variable Environment Type What DAWNFIX_AI_API_KEYdawnfix-agentTest your AI API key (Claude today) DAWNFIX_HOST_TOKENdawnfix-publishStaging a repository access token: repository write, pull requests write, pipelines write. Or an Atlassian API token, with DAWNFIX_BITBUCKET_EMAIL (not secret) beside it DAWNFIX_ENTERPRISE_KEYdawnfix-reportProduction optional, Enterprise only DAWNFIX_AWS_ROLE_ARNandDAWNFIX_AWS_REGION, orDAWNFIX_GCP_WIF_PROVIDER. Optional:DAWNFIX_AUTONOMY,DAWNFIX_AI_MODEL,DAWNFIX_INSTALL_COMMAND. Each run records a deployment in the three environments: that is how Bitbucket keeps a secret to one step. - Add the schedule. Repository settings > Pipelines > Schedules: your main branch, the custom pipeline
dawnfix, hourly. The pipeline never runs on a push. To run it once by hand: Pipelines > Run pipeline, custom: dawnfix, withDAWNFIX_DRY_RUN=truefor a dry run, orDAWNFIX_BASELINE=trueto record the errors you already have.
The CLI on your machine
To check .dawnfix.yml or run one read by hand, install the Python CLI from PyPI (Python 3.11+, version 0.5.0). Add [gcp] for Cloud Logging:
python3 -m venv .venv-dawnfix
.venv-dawnfix/bin/pip install dawnfix
.venv-dawnfix/bin/dawnfix validate --config .dawnfix.yml
Without PyPI, install the same package from the public repo's release tag: pip install "dawnfix @ git+https://github.com/dawnfix/dawnfix@v0.5.0".
What it costs you
Dawnfix itself is free and needs no key. It runs on accounts you already pay for, and those bills go to you, not to us:
- Claude tokens, on your own AI API key. Only the diagnose or fix job uses them, and only on a run that found a new error. A quiet hour spends none.
limits.fix_prs_per_daycaps a busy day. - GitHub Actions minutes. The read job runs every hour for about a minute: about 720 minutes a month on the default schedule, plus the agent jobs when they run. Free on public repos; on private repos they count against your plan's included minutes.
- AWS API calls in your account:
FilterLogEventsandDescribeAlarms, andGetMetricDatafor load balancer 5xx ($0.01 per 1,000 metrics). - AWS Cost Explorer, for Receipt only: $0.01 per request, one per deploy.
What the workflow runs
One workflow, dawnfix.yml, with no license gate:
- Read job. Deterministic, no LLM. It takes the read-only role, reads the last window of errors, fingerprints, dedupes and redacts them. Nothing new: the run stops and spends no tokens.
- Diagnose job (
autonomy: diagnose). One issue per new error with the cause, the impact and a severity. The agent has no shell and the job can only write issues. - Fix job (
autonomy: planordraft-pr). A failing test, then the fix, as a draft PR. It never merges. Withplanit opens an issue with the planned test and fix instead.
Security and data flow lists the permissions of each job.
Optional CI workflows
Free to run, in your own Actions. Each one sends counts to the hosted service only when DAWNFIX_ENTERPRISE_KEY is set. Each is a short caller of a reusable workflow, like dawnfix.yml:
dawnfix-parity.yml: config drift and secret inventory, weekly and on pushes. It callsdawnfix/dawnfix/.github/workflows/parity.yml@v0.dawnfix-flare.yml: the Cloudflare audit, every day. It callsdawnfix/dawnfix/.github/workflows/flare.yml@v0.dawnfix-receipt.yml: the cost comment on every production deploy. It callsdawnfix/dawnfix/.github/workflows/receipt.yml@v0.fleet/templates/fleet-collect.yml: the Fleet collector, for every client's accounts.
Use it from your coding agent
Prefer to have an agent do the setup or run a tool? The prompts folder holds short, copy-paste prompts for any coding agent. Each one runs the real CLI and reads its output.
prompts/setup.md: set Dawnfix up in a repo, step by step.prompts/diagnose.md: diagnose a finding by hand.prompts/fix.md: write the failing test and the fix.prompts/status.md: read the last runs and say what needs you.prompts/tick.md: run one read locally and explain it.prompts/logbill.md: scan the CloudWatch Logs bill.prompts/parity.md: compare two environments.prompts/flare.md: audit Cloudflare accounts.prompts/sweeper.md: find what a migration left behind.prompts/leastpriv.md: trim an IAM role's unused permissions.prompts/receipt.md: price a deploy's cost change.prompts/parity-ci.md: add the Parity check to CI.prompts/flare-ci.md: add the daily Flare audit to CI.prompts/fleet-setup.md: add a client to Fleet.
Enterprise and the service URL
With a Dawnfix Enterprise key in the DAWNFIX_ENTERPRISE_KEY secret, the workflows send counts to https://dawnfix.dev for the status page, the daily digest and the alerts. Every field that is sent. To get a key, contact us at dawnfix@sivakoza.ai. It is a monthly subscription, priced per organization.