Skip to content

Configure

Configuration, policy and doctor

File Owner Read from
sych.yaml process owner / operator --config or the personal config directory for local reviews
.sych/config.yaml repository owner Git objects of the target tip (--base)
.sych/rules.yaml, effects.yaml, deploy.yaml (DEPLOYMENT.md), optional schema-lint.yaml (DB_SCHEMA.md) repository owner same; paths are set in policy.*_file
.sych/contracts/** repository owner same; hashed as is

For local reviews, an explicit --config takes precedence. Otherwise Sych looks for $XDG_CONFIG_HOME/sych/sych.yaml. When XDG_CONFIG_HOME is unset or relative, it uses ~/.config/sych/sych.yaml on Linux, ~/Library/Application Support/sych/sych.yaml on macOS, or %APPDATA%/sych/sych.yaml on Windows. Without a file at that location, Sych uses built-in defaults.

Set the top-level default_models in the personal config to a profile name, roles, or fake. This setting applies to local reviews that omit --models. Without it, Sych uses fake, makes zero model calls, and prints a setup hint to stderr.

Working examples: examples/personal/. Secrets are not stored in the configuration: *_env holds only the environment variable name (UPPER_SNAKE_CASE); a secret value in that position is rejected without printing the value itself.

  • An unknown key is an error with the exact path: sych.yaml: models.providers.openrouter.endpont: unknown field ….
  • Enums in YAML are lowercase snake_case; they are converted to domain JSON in a typed way (for example, severity_on_violation: high → Severity::High).
  • schema_version is required; an unknown major version is rejected.
  • Only config.yaml, the files from policy.*_file and contracts/** are allowed in .sych/; an extra file, a symlink, a submodule or a file larger than 1 MiB is an error. Symlinks are not resolved.
  • A duplicate rule ID is a conflict between required rules and a configuration error; the model does not resolve it.
  • contract_refs must point to files in .sych/contracts/ of the accepted policy.
  • A repository cannot exceed server ceilings: context.max_tokens_per_request ≤ budgets.analysis.max_input_tokens.
  • tooling.dependency_install (default false) allows installing the dependencies of the repository under review for semantic analysis: pnpm install --frozen-lockfile --ignore-scripts --ignore-pnpmfile with the pinned pnpm from packageManager, and cargo fetch of the workspace and std into a Sych-owned CARGO_HOME; easement’s projects get the same installs for each lockfile directory (SEMANTIC.md). It runs only in tooling.sandbox.backends (in order: bwrap, docker; the first available one is used, the rest are fallbacks). docker requires docker_image with an @sha256: digest and currently installs only pnpm. on_unavailable: fail (default) stops the review with TOOLING_UNAVAILABLE (code 3) if no backend is available or the installation failed; degrade continues without dependencies, with a limitation.
  • tooling.indexers bounds each run of the pinned SCIP indexers, architecture review’s (ARCHITECTURE.md) and easement’s: timeout_seconds (600) of wall clock, memory_mb (4096) of memory the run and every process it starts hold resident together, read from /proc every 100 ms (a run may pass it for that long, and one shorter than that is not measured); past either the run is killed. Architecture review also reads no index past max_index_mb (512), indexes no project past max_files (5000) source files and analyses at most max_projects (4) projects of a change. A project past a bound is reported as not analysed, never as clean; 0 is a config error. The bounds are the server’s: a repository cannot raise them.
  • redaction extends the built-in secret redaction (private keys, ghp_/sk-/AKIA… tokens, values of password/token/api_key… keys) and never replaces it. token_prefixes are token prefixes (16+ [A-Za-z0-9_-] characters are required after the prefix), secret_keys are key name substrings (case-insensitive), patterns are regular expressions (regex crate syntax, linear time); each match is replaced with [REDACTED] in DATA blocks before they are sent to the model. An empty prefix or key, an invalid expression or an expression that matches the empty string is a configuration error with the path redaction.patterns[N]. It is set only in the trusted sych.yaml: repository policy cannot weaken or pollute redaction. All other places (logs, provider errors, configuration output) use the built-in rules.

Execution is enabled only in sych.yaml together with execution.allowed_profiles; it is disabled by default. An allowed profile must be defined in execution.profiles: a docker image pinned by @sha256:, an absolute executable inside it, args that are literals or {param, one_of: [...]} choices, timeout_seconds, the report format of its stdout and limits (memory_mb 2048, cpu_millis 2000, pids 512 by default). A request can only pick listed values and cannot add arguments; neither the model nor the repository writes a command line.

When enabled, every allowed profile runs once per review without parameters, unless the review request names checks: checks: [{profile, params}] in POST /v1/reviews or sych review --check PROFILE[:PARAM=VALUE,...] (repeatable) runs only those, each argv still built by the server’s profile; a check is named <profile>{"<param>":"<value>",…} in its job, gaps and runner. A new generation from a push or a rerun takes no checks and runs every allowed profile; a successor for CI that arrived after the freeze keeps its parent’s checks. A check runs on the pinned head: the head is materialized into a fresh workspace (secrets, symlinks, submodules and tool configs left out), mounted as the only volume of a docker container with --network none, --cap-drop ALL, --read-only, no-new-privileges and the limits; the environment carries no Sych secret. Docker is the only backend for repository code. The stdout is imported as a CI report bound to the head (TrustClass::DerivedLocal, binding ENVIRONMENT, runner <check> in <image>, the check named as above); a non-zero exit is a result, not an error. A refused (disabled, not allowed, missing or invalid parameter) or failed run is a task gap EXECUTION_REFUSED / EXECUTION_FAILED, never a passed check; a profile with choices that runs without a request is refused as missing them. A quality eval case may carry its own execution: {profiles, checks}, used instead of the suite config’s and validated by sych eval validate.

A failure/retry/cancel/unmount check prints sych_manifest with assertions: [{name, expected: [event], observed: [event]}]: an assertion passes only when the recorded event order equals the expected one; without observed it is SKIPPED (not run, never a pass), so a matching return value alone proves nothing. With compare_base: true (needs report) the profile also runs on the diff base in its own workspace; every head outcome whose status differs is named BASE_DIFFERS: <suite>/<name> is <base> on the diff base and <head> on the head (a non-zero base exit or paths left out of the base workspace are named BASE: … beside it), and a base that could not run is BASE_NOT_RUN. The base run only labels the head report; it is never evidence of its own. For example, a relay that retries publish after an injected crash on the base and drops it on the head (the quality case relay-retry-trace-unsafe): the base records commit, crash, publish, the head commit, crash, so the head’s assertion is FAILED and named BASE_DIFFERS: assertion/publish retried after a crash is Passed on the diff base and Failed on the head.

Without runtime evidence the verifier keeps a bounded static argument or a concrete UNKNOWN; generating new tests is optional and never done by the tour reader.

execution:
enabled: false
allowed_profiles: [go-test]
profiles:
go-test:
image: golang:1.26@sha256:<digest>
executable: /usr/local/go/bin/go
args: [test, -json, ./...]
timeout_seconds: 300
report: go_test_json

Engine defaults → sych.yaml → accepted repository policy. The effective config is normalized (all defaults filled in) and gets a config_hash (server + repository config) and a rules_hash (rules, effects, deployment, contract hashes). PolicySnapshot.id depends on the source, both hashes and the authorization policy version. provenance lists the layers with SHA-256 of the source files; it contains no secret values.

The path/domain layer is expressed through rules’ applies_to.paths; engine generic rules come after repository rules and are replaced by them by ID. There is no separate layer for personal preferences.

review.language in .sych/config.yaml is en (default) or ru; any other value is a config error. Every model prompt asks for human-readable fields (titles, claims, explanations, questions, suggestions) in that language, with code, identifiers, paths, ids and enum values unchanged, and the static text of the summary and inline comments is rendered in it. The language is part of the policy snapshot and of every prompt, so a change of language makes a new policy id and new checkpoint keys.

review.block_on in .sych/config.yaml lists globs of rule ids (["SEC-*"], ["EFFECT-01", "MIG-*"]) whose open findings fail the check run instead of leaving it neutral (SERVER.md); the result lists them in blocked_by. Naming a kind: preference rule literally in review.block_on is rejected by config validate, and NIT / IMPROVEMENT findings never enter blocked_by even when matched by a glob such as API-*. A run that fails before a result fails the check too, as it checked none of them, once a run of the change has read a policy with block_on; a change none of whose runs got that far stays neutral (SERVER.md). A finding of a waived obligation does not block, as it does not raise the recommendation. The policy comes from the target tip, so a change cannot lift its own block. Unset, the review stays advisory, and the key is left out of the policy snapshot. Add it only once the deployed reviewer knows it: an older one refuses the unknown key.

review.fixture_paths in .sych/config.yaml lists globs of labelled data whose code is not the product: eval cases, golden files, recorded fixtures. Their code may hold planted defects on purpose, so a discovery candidate whose every anchor lies in these paths is dropped (kept among the refused drafts with anchored only in labelled fixture data). A candidate with one anchor elsewhere is reviewed as usual, and the files are still shown to the model and checked by the obligations that cover them (TEST-INTEGRITY among them). Unset, nothing is dropped; while empty it is left out of the policy snapshot, so a config without it keeps its policy id.

architecture in .sych/config.yaml sets the bounds of the architecture checks: enabled (default true) and limits with tangle_members (7), shallow_functions (7), wide_directory (15) and long_file (2000), the defaults being deslop-please’s. A tangle all in one module is reported past tangle_members things; a module is shallow past shallow_functions functions shown, at most as many hidden, and a list (of things, or of one thing’s functions) past the same bound; a directory holds at most wide_directory files and directories of code, a file at most long_file lines. A bound of 0 is a config error. As every key here, it is read from the target tip, so a change cannot loosen the bounds its own code is judged by. A required rule ARCH-<CHECK> makes a finding of that check a rule violation, and its exceptions waive it (ARCHITECTURE.md). Add the key only once the deployed reviewer knows it: an older one refuses the unknown key.

schema_lint in .sych/config.yaml enables Sych’s built-in database and application schema linter during review (enabled: false by default). Rules, options, exclusions and model extraction settings may live inline under schema_lint or in a separate file referenced by policy.schema_lint_file (typically .sych/schema-lint.yaml), read strictly from the target tip so a PR cannot weaken rules or hide violations. Open findings emit DB-* rule ids (and DB-STALE-EXCLUSION) that integrate with review.block_on and waivers. Optional read-only live database connections on the server are defined only in trusted sych.yaml under schema_lint.connections.<name> with dsn_env, timeout_seconds and a repositories allowlist ([] denies all repositories on a server). Full reference: DB_SCHEMA.md.

sych review reads .sych/ only from the target tip. Changes to .sych/ in the head under review go into policy_diff (files, rule IDs, errors of the proposed policy after redaction) and do not affect the current run. An invalid policy on the target tip is exit 2. AGENTS.md, CLAUDE.md and other files outside .sych/ do not become policy.

A new trusted revision is applied only by a separate explicit operator run: sych review … --policy-ref REF reads .sych/ from commit REF instead of the target tip; the result’s policy.source is {ref_name: REF, commit}, and a warning is written to stderr. Head still remains only a diff.

A rule ID is stable; a change of meaning bumps version. Meaning is kind, required, severity_on_violation, applies_to, statement, acceptance, contract_refs, check; title, owner, rationale and exceptions may change within the same version. A rule proposed in head with a new meaning and the previous version goes into policy_diff.head_errors («changes its meaning without a version bump»).

Applicability to a change is three-valued:

  • APPLIES — the old or new path of a changed file matched applies_to.paths (moving a file outside the paths does not lift the rule), or the changed construct is called or referenced from these paths according to semantic facts — then limitations record «applies through a semantic link: name is used from path:line».
  • DOES_NOT_APPLY → NOT_APPLICABLE with a verifiable basis (no path, no semantic link).
  • UNKNOWN — incomplete diff, unresolved change_kinds, or a generic domain rule without its input (DEPLOYMENT_INPUT_MISSING, TERRAFORM_PLAN_MISSING, K8S_MANIFESTS_MISSING).

A rule in .sych/rules.yaml may declare a typed check: matcher (kind in snake_case, unknown fields rejected by config validate, compatible with acceptance.evidence_kinds when set). Rules with check: run deterministically on pinned HEAD before model passes and make zero model calls:

  • forbid_edge (from: [...], to: [...]) — forbidden dependency edges over the SCIP dependency graph (ARCHITECTURE.md) across Rust, Go, TypeScript/JavaScript and Python, including uses forwarded through shallow wrappers. Selectors match normalized module prefixes (crate::http, pkg/api, src/ui) or repository-relative path globs (crates/sych-core/**).
  • forbid_symbol (languages: [...], symbols: [...]) — forbidden resolved SCIP references and AST imports (including import aliases) inside changed constructs on HEAD across rust, go, typescript, javascript and python.
  • effect (rule: {kind, ...}) — matchers over the effect ledger (SEMANTIC.md) and HEAD syntax facts:
    • require_transaction (effects, kinds, at least one non-empty): matched effects on HEAD must execute inside a resolved transaction scope (none → VIOLATED; unknown, non-resolved resolution or implementation_changed → UNKNOWN; transaction → SUPPORTED).
    • forbid_detached (effects, kinds, at least one non-empty): matched effects on HEAD must not execute inside a detached: lifetime scope (detached: → VIOLATED; dynamic_unknown or implementation_changed → UNKNOWN).
    • require_companion (trigger_effects, required_effects, both non-empty): every (path, symbol) on HEAD that invokes a trigger effect must also invoke at least one required companion effect in the same symbol (missing companion → VIOLATED; missing enclosing symbol, dynamic_unknown or implementation_changed → UNKNOWN).
  • syntax (rule: blank_line_after_if) — closed AST syntax rules evaluated over pinned HEAD Git blobs (sych-style over .rs files).
rules:
- id: ARCH-CORE-DEPS
version: 1
kind: invariant
title: Core stays independent of adapters
statement: sych-core must not depend on sych-adapters.
required: true
severity_on_violation: high
applies_to:
paths: ["crates/sych-core/**"]
check:
kind: forbid_edge
from: ["crates/sych-core/**"]
to: ["crates/sych-adapters/**"]

For kind: invariant, deterministic assessment is three-valued: VIOLATED cites sych-rule-check evidence anchored on the exact HEAD CodeRefs; SUPPORTED is emitted only when the underlying SCIP index, effect ledger or syntax parse is complete for the checked scope; partial or unavailable SCIP indexing, EffectLedger unknown / dynamic_unknown / implementation_changed gaps or unparseable syntax without an observed violation yield UNKNOWN with the gap code, never SUPPORTED. Waivers, review.block_on and finding lineage apply identically to model-assessed rules. For kind: preference, a matched violation emits a deterministic NIT or IMPROVEMENT finding capped at LOW with support: PREFERENCE and rule_id, keeps active waivers in limitations, and is omitted from model prompts.

The engine ships a generic rule pack. A rule is enabled by its review.profiles profile and creates an obligation only when the change concerns it; a repository rule with the same ID replaces the generic one.

ID Profile Activation Current assessment
EFFECT-01 side_effects a path from effect registry implementation_refs is changed, or an effect ledger entry is not preserved model, based on the ledger (SEMANTIC.md)
EFFECT-02 side_effects syntax shapes of errors, cancellation and lifetime in changed lines (including swallowed_exception), or a ledger entry with changed lifetime/failure model
MIG-COMPAT, MIG-RESTART, MIG-CONTRACT, MIG-RECOVERY migration_compatibility **/migrations/**, **/migrate/**, *.sql model, against the deployment model’s transition matrix (DEPLOYMENT.md); UNKNOWN without a required owner input
TF-CHANGE infrastructure *.tf, *.tfvars model, against a Terraform plan imported for the head; UNKNOWN (TERRAFORM_PLAN_MISSING) without one
K8S-ROLLOUT infrastructure k8s/, helm/, charts/ model, against rendered manifests imported for the head; UNKNOWN (K8S_MANIFESTS_MISSING) without them
TEST-INTEGRITY correctness tests or CI gates changed, or a new skip/#[ignore] or suppressed lint in changed lines model

All generic rules are required: a missing input does not make a rule optional but leaves UNKNOWN with the name of the missing evidence. Checking tests does not substitute for an accepted requirement: an assessment that relies only on a test from the same change is TEST_ORACLE_ONLY.

The security profile (on by default) scans the lines a change adds, without a model; each hit is a finding with its rule (HIGH, MEDIUM for supply-chain signals), one per rule and file, anchored on up to five of its lines. Generated files and review.fixture_paths are skipped.

ID Finds
SEC-SECRET a private key block or a token in a well-known format (GitHub, GitLab, Slack, AWS, Google, OpenAI); also an added or changed file that is_secret_path denies, which is never read. The value is never quoted. A value assigned to a key such as password is redacted but not reported, since password = os.environ[...] looks the same
SEC-SUPPLY-CHAIN a manifest line that takes code from outside the package registry or runs it on install: an npm preinstall/install/postinstall script (a version range under those keys is a dependency named install, not a script) or a git+/github:/file:/URL dependency in package.json; a git dependency in Cargo.toml or pyproject.toml (a Cargo path dependency is not reported: every workspace has them); a git+ or direct-URL requirement or --index-url/--extra-index-url/--trusted-host/--find-links in requirements*.txt; a replace (=>) in go.mod. Lockfiles and comments are left out. A signal, not proof: an intended git dependency is common
SEC-HIDDEN-TEXT a bidi override or isolate (Trojan Source, CVE-2021-42574) or an invisible character (U+200B, U+2060, a U+FEFF past the start of the file); joiners are allowed

kind: preference is never required, cannot declare severity_on_violation above low, and never creates an obligation or ends in UNKNOWN. Prompt preferences matched to a review unit (by applies_to.paths on either side or a semantic caller/reference link, excluding rules with check:; see Deterministic rule checks) are passed to discovery, combined review and verification under # Preferences of this change as pref-1, pref-2, …, together with any rationale and contract_refs; units with no matched preferences omit the section so their prompt hashes stay unchanged. Confirmed preference findings keep NIT or IMPROVEMENT, severity <= LOW, support: PREFERENCE, and rule_id set to the preference’s id across JSON, Markdown, SARIF, the GitHub summary and quality analytics; a nitpick without a rule_id is still allowed, and zero nitpicks is a normal result. Active exceptions[] and server waivers on a preference keep the finding in ReviewResult.findings and record {rule_id}: waived by {owner} ({reason}); the finding is kept in limitations (expired or non-covering exceptions are noted in limitations as well), without changing Coverage or Recommendation.

A rule’s exceptions[]: paths, reason, owner, author and expires_at or an until condition. An exception whose paths touch the change and which is in force at the time of the run becomes a waivers[] entry of an obligation with status VIOLATED or UNKNOWN: the status and the rule violation finding are kept, but such an obligation does not raise the recommendation (neither ATTENTION_REQUIRED nor NEEDS_EVIDENCE), while coverage still counts it. An expired exception is not applied and is recorded in limitations.

  • is_secret_path — default deny for .env* (except *.example|sample|template|dist), keys (*.pem, *.key, id_rsa…), credentials, .npmrc/.netrc, *.tfstate*, .ssh/.aws/.gnupg/.terraform directories. Such files remain in the diff manifest with the SECRET_PATH limitation; their contents must not reach the context/model.
  • redact replaces private key blocks, known token formats and values of keys like password/secret/token/api_key with [REDACTED]. It is applied to configuration error messages and to the output of config validate/doctor. This is a heuristic, not a guarantee.
  • ServerConfig::egress_allowed — an allowlist by provider endpoint (https:// or loopback http://). The URL is parsed: userinfo is forbidden; origin (scheme, host, port) and path segments are compared, not a string prefix.
  • A profile’s billing_kind/enforcement must match the provider adapter: openrouter/openai_compatible — api_usage + api_hard, subscriptions — subscription_quota + subscription_observable.
Terminal window
sych config init --personal # writes ./sych.yaml, leaves an existing file untouched (exit 2)
sych config validate --config sych.yaml --repo .
sych doctor --config sych.yaml --repo .
sych review --repo . --base main --head HEAD --config sych.yaml --models fake
  • config validate checks the schema, paths, role → profile → provider references, fallback chains and limits, reads .sych/ from the working tree (for authoring) and prints the effective config as JSON. Errors go to stderr, exit 2.
  • doctor additionally checks the Git repository, the presence of environment variables (only «set/not set»), write access to the artifact store and parsing of the price catalog (format — MODELS.md). It does not deploy, does not publish a comment, and calls a model only with --probe-model PROFILE (see MODELS.md). Exit 0 on ok/warn, 4 on FAIL, 2 on an invalid configuration.
  • doctor --scm-smoke CONNECTION --pr N is the one explicit write: through the connection’s first repository it creates a comment marked <!-- sych:smoke:<uuid> -->, reads it back by id, updates it, reads it again, finds it by marker as the App’s own and deletes it, then prints a JSON report (installation id, permissions, capabilities, comment id, body hashes; no tokens). Local checks are skipped, so it runs in the server image. Exit 0 when the comment was found and is gone.