Configuration reference
Schemas for .t12/config.json and .t12/preferences.json, fixed rules, env file format, and environment variables.
Project repo (`.t12/`)
.t12/config.json: The project's config: stack, commands, globs, and branch names (project.Parserejects unknown keys)..t12/preferences.json: Autonomy, budgets, slots, and merge policy (updated viat12 config set)..t12/project.json: The profile, with the rules every task of the project shares (profile.Parse, checked byt12 profile-check). It is not the project's config.
Local host (`~/.config/t12/env`)
- Host credentials & tuning:
DATABASE_URL, harness choice, Docker engine, SMTP, and API tokens. - Strict permissions: Must be mode
0600(envfile.Loadexits otherwise). Process env vars override file values.
# Minimal ~/.config/t12/env (chmod 600)
DATABASE_URL=postgres://user:password@ep-example-pooler.region.aws.neon.tech/neondb
T12_HARNESS=agy
T12_MODEL=gemini-4-neon
T12_THINKING=medium
T12_SANDBOX_ADAPTER=docker.t12/config.json
A repo written before the rename keeps .t12/product.json, which is still read when .t12/config.json is absent.
| Key | Kind | Req | Default or constraint | Safety | Description |
|---|---|---|---|---|---|
schema | number | No | 1 (1..1) | No | File layout schema version. |
name | slug | Yes | ^[a-z0-9][a-z0-9-]*$ | No | Project slug name. |
type | choice | Yes | web-blog or web-app | No | Project type selecting the default catalogue. |
stack | text | Yes | Non-empty string | No | Summary of the project technology stack. |
repository | text | No | owner/repo slug (^[A-Za-z0-9_.-]+/[A-Za-z0-9_.-]+$) | No | Connected GitHub repository for adopted/linked projects. |
cage_image | text | No | Non-empty (golang:1.27, t12-web-blog:2, or project.Detect stack image) | No | Docker image for caged commands and installs. |
branches.staging | text | No | "staging" (or "t12-staging" on adopted repos) | No | Branch where verified lanes merge first. |
branches.main | text | No | "main" (on an adopted repo: its current branch, else main or master) | No | Release branch merged only after human sign-off. |
delivery.target | choice | No | "cloudflare-workers" | No | Deployment target identifier. |
commands.install | command | Yes | Non-empty argv list | No | Installs dependencies (runs with network access). |
commands.build | command | Yes | Non-empty argv list | No | Builds the project. |
commands.lint | command | Yes | Non-empty argv list | No | Runs static lint checks. |
commands.typecheck | command | Yes | Non-empty argv list | No | Runs static type checks. |
commands.unit | command | Yes | Non-empty argv list | No | Runs the full unit test suite. |
commands.unit_files | command | Yes | Argv list containing {files} once | No | Runs named unit test files. |
commands.mutate | command | No | Argv list containing {mutate} once | No | Runs changed-line mutation tests (reports/mutation/mutation.json). |
commands.e2e | command | No | Non-empty argv list | No | Runs browser E2E scenarios (reports/e2e/results.json). |
commands.serve | command | No | Non-empty argv list | No | Starts project against a fresh local DB in cage. |
serve_url | text | No | Non-empty string | No | URL where commands.serve listens (expects /healthz). |
commands.deploy_dry_run | command | Yes | Non-empty argv list | No | Builds the deployable artifact and stops before upload. |
globs.test | paths | Yes | Non-empty list of valid globs | No | Globs identifying test files. |
globs.source | paths | Yes | Non-empty list of valid globs | No | Globs identifying project source files. |
deslop.exclude_paths | paths | No | Non-empty list of valid globs | Yes | Paths omitted from Deslop checks (Operator approval required). |
commands.* must be argv arrays, never shell strings; project.CheckCommand blocks shell metacharacters in argv[0] and flags like --dangerously-skip-permissions, --no-sandbox, and --bypass-sandbox.
project.Detect picks node:26-bookworm, oven/bun:1, golang:1.24-bookworm, python:3.12-slim, or rust:1-bookworm, while StackTags tags effect (effect/@effect/*), cloudflare-workers, typescript, javascript, nodejs, go, python, and rust.
.t12/preferences.json
Safety-group preference approvals
t12 config set updates .t12/preferences.json on staging and records a decision in the decisions table. When a non-Operator changes a Safety key, it stores a pending proposal document until an Operator approves it.
| Key | Kind | Default or constraint | Safety | Description |
|---|---|---|---|---|
schema | number | 1 (1..1, read-only via t12 config set) | No | File layout schema version. |
flow | choice | "team" (team, classic) | No | The steps each part runs. team: Tech Lead plans, Developer builds, QA runs the tests, the screens and one review, DevOps runs the merge policy, merge and deploy dry run. classic: Analyzer, Engineer, QC, UI check, Deslop, Red team, Code review, merge policy, merge, deploy dry run, SRE. A conversation keeps the flow it started with; one whose parts ran before flows existed keeps classic. |
roles.default.harness | choice | T12_HARNESS or "agy" (agy, omp, claude) | No | Default agent harness for all roles. t12 ui offers only agy and omp; a saved claude choice runs through omp on an anthropic/ model. |
roles.default.model | text | T12_MODEL (or "gemini-4-neon" for agy) | No | Default model identifier for all roles. |
roles.default.thinking | choice | T12_THINKING or "medium" (agy: low..xhigh, claude: low..max, omp: off..max) | No | Default reasoning effort ("default" resets to harness default). |
roles.<group>.harness | choice | Unset (inherits roles.default) | No | Per-group harness override (review, judge, explorer, observer). |
roles.<group>.model | text | Unset (inherits roles.default) | No | Per-group model override (review, judge, explorer, observer). |
roles.<group>.thinking | choice | Unset ("default" or harness levels) | No | Per-group reasoning effort override (review, judge, explorer, observer). |
budgets.retry_tokens_per_task | number | 2 (0..5) | Yes | Pooled retry tokens per task when a blocking finding sends a lane back to the Analyzer step (the Strategist agent decides only in the classic flow). |
budgets.fix_attempts_per_lane | number | 3 (1..5) | Yes | Mechanical fix attempts given to Engineer within one lane. |
budgets.diff_cap_lines | number | 800 (T12_DIFF_CAP_LINES, 0..10000) | No | Max added source lines per candidate before splitting (0 disables). |
budgets.wait_hours | number | 0 (-1..720; 0 is 24 hours, -1 never) | No | Hours a conversation may wait on a person before it is paused (stops costing resources until someone acts). |
autonomy.level resolution
Preferences.ResolveAutonomy(override) (internal/project/autonomy.go) lets T12_AUTONOMY (injected by t12 ui from the approval-mode document) override .t12/preferences.json, computing budgets as max(configured, levelFloor).
| Level | FixAttempts floor | RetryTokens floor | StepRetries | AnswerQuestions | PartsWait | MatchesWait |
|---|---|---|---|---|---|---|
review | 0 (configured) | 0 (configured) | 0 | 0 | true | true (even if policy is "auto") |
default | 0 (configured) | 0 (configured) | 0 | 0 | false | merge_policy.mode != "auto" |
auto | 4 | 3 | 2 | 1 | false | merge_policy.mode != "auto" |
turbo | 5 | 5 | 4 | 3 | false | false (data-loss still waits) |
Fixed rules (project.FixedRules)
- Every pass rule is a script, and the Orchestrator never calls a model.
- The event hash chain, role reports, and decision records for choices with alternatives.
- Every agent command runs in the cage.
- A person merges
stagingtomain; mirrors are read-only. - The must-haves only the person can give block the start.
- New tests fail on base and kill a mutant.
- The agent never edits its own rules.
- The root-cause repeat cap sends a second repeat to a different route and turns a third repeat into a Problem.
- Context creator trust status is derived.
- No code comments outside the directive allowlist.
- The project repo cannot add MCP servers.
- No step of the conversation's flow can be switched off.
~/.config/t12/env format
Strict 0600 permissions required
envfile.Load (internal/envfile/envfile.go) exits immediately if group or world permissions are set (chmod 600 required). A missing file is ignored without error.
- Syntax: Skips blank lines and
#comments, strips optionalexport, splits on the first=, and trims outer quotes. - Literal paths: Values never expand
~or$HOME; pass full paths like/Users/<you>/.config/t12/claude. - Precedence: Existing process environment variables (
os.LookupEnv) override file entries.
Environment variables
| Variable | Default | Used by | Description |
|---|---|---|---|
DATABASE_URL | Required | t12, t12-ui, t12-cloud-worker, Vercel function, t12-container (host side) | Pooled Neon postgres:// connection string. Without it a process stops with db.ErrNoDatabaseURL. Stripped from child processes; staging and production use separate databases. |
T12_PROJECT_ENV_KEY | Empty | internal/projectenv, internal/connections | Base64 (or 64 hex digits) of 32 random bytes. Seals project variables and each person's connections; never stored in the database. |
T12_SHARED_CREDENTIALS | Off | internal/connections, internal/ui, t12-cloud-worker | 1, true, yes, or on lets an Operator without own connections use the factory's own GitHub and agy/omp credentials. Everyone else connects their own. |
T12_GITHUB_CLIENT_ID, T12_GITHUB_CLIENT_SECRET | Empty | t12-ui, internal/connections, t12-cloud-worker | The GitHub App's pair. Both set turns on Sign in with GitHub and lets runs refresh people's GitHub tokens. |
T12_GITHUB_OWNER | Empty | t12-ui, t12-cloud-worker, cloud backend | Owner for new repositories made on the factory's shared GitHub token. A person with their own GitHub always uses their own login. |
T12_OPERATOR_EMAIL, T12_OPERATOR_PASSWORD | Empty | Vercel function | When the database has no Operator, creates or promotes this account with this password on the first request. |
T12_UI_SUMMARY_STORE | On | t12-ui | Set off to stop storing ui-home-summary documents. They are only a cache, so deleting them is safe. |
T12_DB_ENDPOINT | Empty | internal/db, tests | Sends SQL to another endpoint than the one DATABASE_URL's host serves: https, unix://, or http to loopback only. Tests use it for t12-neon-local. |
T12_DB_BROKER | Unset | internal/db | Unix socket of the host's database broker. t12-container sets it inside the container; do not set it by hand. |
T12_TEST_DATABASE_URL | Empty | internal/db/dbtest | Test database (t12_test; the name must contain test). Database tests skip when it is unset; never reads DATABASE_URL. |
T12_TEST_DB_SCHEMA | Unset | internal/db | Scopes a child t12 to one test schema; set by dbtest, not by hand. |
T12_TEST_PG_HOME, T12_TEST_PG_PORT, T12_TEST_SHIM_PORT | ~/.local/share/t12/pg, 54328, 54329 | scripts/test-db.sh | Where the local test Postgres lives and the ports of Postgres and the t12-neon-local shim. |
Internal runtime variables (T12_TASK_ID, T12_ROLE, T12_ROLE_KIND, T12_SESSION, T12_WORKTREE, T12_GUARD_POLICY, T12_CAGE_EXEC, T12_DOCS, T12_PROBE_SECRET, T12_UI_PROGRESS, T12_GH_TOKEN) and the worker workflow's T12_INPUT_* inputs are managed by the factory and should not be set manually.
Stripped variables (sandbox.IsForbiddenEnvKey)
Exact names (case-insensitive): AGY_ADC_AUTH, ASANA_ACCESS_TOKEN, ASANA_PAT, ASANA_TOKEN, AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, AWS_SESSION_TOKEN, ANTHROPIC_API_KEY, DATABASE_URL, GITHUB_TOKEN, GH_TOKEN, GOOGLE_APPLICATION_CREDENTIALS, GOOGLE_CLOUD_LOCATION, GOOGLE_CLOUD_QUOTA_PROJECT, GOOGLE_GEMINI_BASE_URL, OPENAI_API_KEY, PRODUCTION_DATABASE_URL, SUPABASE_SERVICE_ROLE_KEY, STRIPE_SECRET_KEY, SLACK_BOT_TOKEN, TURBO_GITHUB_TOKEN, SSH_AUTH_SOCK, SSH_AGENT_PID, GIT_ASKPASS, SSH_ASKPASS, GIT_SSH, GIT_SSH_COMMAND, GIT_DIR, GIT_WORK_TREE, GIT_COMMON_DIR, GIT_INDEX_FILE, GIT_OBJECT_DIRECTORY, GIT_ALTERNATE_OBJECT_DIRECTORIES, GIT_CONFIG_PARAMETERS, GIT_CONFIG_COUNT, PYTHONPATH, PYTHONHOME, PYTHONSTARTUP, PYTHONUSERBASE, LD_PRELOAD, DYLD_INSERT_LIBRARIES, XDG_RUNTIME_DIR, DBUS_SESSION_BUS_ADDRESS, DBUS_SYSTEM_BUS_ADDRESS, NOTIFY_SOCKET, GPG_AGENT_INFO, DOCKER_HOST, WAYLAND_DISPLAY, and DISPLAY.
Regex patterns (case-insensitive): (^|_)(PROD|PRODUCTION)(_|$), (^|_)(SECRET|PASSWORD|PRIVATE_KEY|ACCESS_TOKEN|AUTH_TOKEN|API_KEY|PAT|TOKEN)(_|$), ^(AWS_|GITHUB_|GH_|ASANA_|STRIPE_|SLACK_|TWILIO_|SENDGRID_|SSH_|GIT_CONFIG_), and ^TURBO_.*_URL$.
Next steps
CLI reference
Every binary under cmd/, exit codes, signal handling, v2 t12 subcommands (including t12 db), and legacy v1 commands.
State home layout
What stays on disk under --home (scratch only), where durable state lives in Postgres (tables, document kinds, leases), and how t12 db import loads an older file-based home.