Dawnfix
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 GitHubGitHub repo whose production runs on AWS (CloudWatch Logs, alarms, ALB) or GCP (Cloud Logging).
  • Node 20 or later, for npx. The gh CLI signed in, and the AWS CLI or gcloud with rights to create one role.
  • Your own AI API key (ClaudeClaude today). It is stored as a GitHub ActionsGitHub 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.

  • GitLabGitLab: GitLab CI, merge requests and issues.
  • BitbucketBitbucket: Bitbucket Pipelines and pull requests. Bitbucket Cloud: diagnose only; fixes on self-hosted runners.
  • CircleCI Not available yet

Steps

  1. Run npx dawnfix init at 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-run to only see them.
    npx dawnfix init
    .dawnfix.yml says what to watch and what Dawnfix may do. Start with autonomy: diagnose; test.command is the one command the fix agent may run later. templates/dawnfix.yml in the public repo lists every key. .github/workflows/dawnfix.yml is 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
    @v0 follows the v0.x releases. Pin @v0.5.0 or a commit SHA instead to freeze it; a commit SHA is the auditable choice. Its cron must equal the schedule in .dawnfix.yml. Want the whole workflow in your repo instead? Copy templates/github/workflows/dawnfix.yml: the same jobs, reading repo variables instead of inputs.
  2. Deploy the read-only cloud role. init prints these commands with your repo's names filled in. On AWS, deploy the CloudFormation template infra/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-1
    verify_readonly.py needs Python with boto3, which the CLI install below brings. On GCP, run infra/gcp/setup-wif.sh. It lets the workflow of this one repo read Cloud Logging in one project through workload identity federation, with roles/logging.viewer and 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
  3. Set two repo settings. A variable and a secret, by name. You type the values; they never pass through anyone else:
    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)
    Optional, Enterprise only: 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.
  4. 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 doctor checks the setup:
    gh workflow run dawnfix.yml -f dry_run=true
    gh workflow run dawnfix.yml -f baseline=true
    npx dawnfix doctor
  5. Later, let it write fixes. After a week of issues you trust, switch autonomy to draft-pr through a PR. For PRs that trigger your CI, use your own GitHub App or a fine-grained token as the PR author.

GitLabGitLab 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-read holds the cloud OIDC token only (id_tokens:). Reads your logs with the read-only role. Deterministic, no AI.
  • dawnfix-agent holds 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-publish holds 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-report holds 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.

  1. Run npx dawnfix init --host gitlab at the root of your project. It writes .dawnfix.yml and 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).
  2. Include the template at the release tag. GitLab checks the file against the integrity hash before it runs it:
    include:
      - remote: https://raw.githubusercontent.com/dawnfix/dawnfix/v0.5.0/templates/gitlab/dawnfix.gitlab-ci.yml
        integrity: sha256-…
    The sha256-… value is the hash of that exact file. The header of templates/gitlab/dawnfix.gitlab-ci.yml says 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
  3. 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.yaml and use its RoleArn output:
    curl -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='*'
    On a self-managed GitLab, add GitLabUrl=https://gitlab.example.com. On GCP, run infra/gcp/setup-wif-gitlab.sh. It prints the provider name to set as DAWNFIX_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
  4. 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:
    VariableEnvironment scopeWhat
    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
    Not secret, no scope: DAWNFIX_AWS_ROLE_ARN and DAWNFIX_AWS_REGION, or DAWNFIX_GCP_WIF_PROVIDER. Optional: DAWNFIX_AUTONOMY, DAWNFIX_AI_MODEL, DAWNFIX_INSTALL_COMMAND. Without --value, glab reads 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
  5. Add the schedule. A pipeline schedule on the default branch with DAWNFIX_RUN=true. The jobs run only when DAWNFIX_RUN is true, so your other pipelines are untouched:
    # 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"
    To run it once by hand: Build > Pipelines > Run pipeline, with DAWNFIX_RUN=true and DAWNFIX_DRY_RUN=true for a dry run, or DAWNFIX_BASELINE=true to record the errors you already have.

BitbucketBitbucket 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 read holds the cloud OIDC token only (oidc: true). Reads your logs with the read-only role. Deterministic, no AI.
  • dawnfix agent holds 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 publish holds 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 report holds 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.

  1. Run npx dawnfix init --host bitbucket at the root of your repository. It writes .dawnfix.yml (diagnose mode) and the pipeline (or the lines to merge into your bitbucket-pipelines.yml), and prints the push restriction, variables, deployments and schedule to set. It never asks for a secret. The pipeline is templates/bitbucket/bitbucket-pipelines.yml at the release tag.
  2. Turn Pipelines on in Repository settings > Pipelines > Settings.
  3. 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 audience ari: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, deploy infra/aws/dawnfix-read-role-bitbucket.yaml and use its RoleArn output:
    curl -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='*'
    On GCP, run infra/gcp/setup-wif-bitbucket.sh. It prints the provider name to set as DAWNFIX_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
  4. 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:
    VariableEnvironmentTypeWhat
    DAWNFIX_AI_API_KEYdawnfix-agentTestyour AI API key (Claude today)
    DAWNFIX_HOST_TOKENdawnfix-publishStaginga 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-reportProductionoptional, Enterprise only
    Never put a secret in repository or workspace variables: those reach every step. Repository variables, not secret: DAWNFIX_AWS_ROLE_ARN and DAWNFIX_AWS_REGION, or DAWNFIX_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.
  5. 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, with DAWNFIX_DRY_RUN=true for a dry run, or DAWNFIX_BASELINE=true to 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_day caps 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: FilterLogEvents and DescribeAlarms, and GetMetricData for 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: plan or draft-pr). A failing test, then the fix, as a draft PR. It never merges. With plan it 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:

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.

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.