Strong opinions, held in code

Seven beliefs Duct is built on, each beside the file that makes it true. If the code ever disagrees with this page, that is a bug, and I would like the issue.

The agent proposes. You approve.

Duct can prepare a change to your ads or analytics. No tool lets it approve one, so it cannot be talked into it.

Anything destructive waits for your click, at every setting.

A short list of reversible changes may apply on their own, and only if you turn that on.

A change-set card waiting for you: pause one campaign, add two negative keywords, one budget raise blocked by a guardrail, Reject and Approve buttons
backend/service/execution/policy.py
def change_auto_eligible(spec: ExecutorSpec, change: dict[str, Any]) -> bool:    """One change may auto-apply: allowlisted, reversible, clean."""    if spec.op_type not in AUTO_APPLY_ALLOWLIST:        return False    if spec.destructive:  # absolute gate, independent of the allowlist        return False    if spec.rollback is None:        return False

Rent the agent framework. Never marry it.

Agent frameworks change every week. Duct's prompts, tools and scoring are plain Python, and a test fails if a framework import appears outside the few adapter files.

backend/agents/core/ports/__init__.py
There is deliberately **no** ``AgentHarness`` interface, and there should neverbe one. Harnesses differ in *capability*, not just API shape:  * Take the intersection and you lose subagents, filesystem, skills, HITL    granularity and compaction — the entire reason to rent a harness.  * Take the union and you are writing a framework, plus adapters for it, which    is strictly worse than the three-engine problem this replaced.

Abstract on the second use.

One implementation is a guess. Two is a fact. The shared adapters were pulled out when a second agent needed them, and the allowlist says which one.

backend/tests/test_harness_boundaries.py
    # -- Shared LangChain adapter: the model-transport + events-out ports for    #    every V1 runner. Extracted from agents/audit/v1/runner.py on the second    #    consumer (insights), per the ports rule.    "agents/core/lc.py":                    "LangChain adapter: resolve_chat_model + stream_agent",    # -- The deepagents session: assembly + loop, extracted from the insights    #    runner on the second consumer (content). The only place deepagents is    #    load-bearing.    "agents/core/deep_session.py":          "deepagents adapter: the session runners' shared assembly + loop",

An API key is not permission.

The app's key ships to the browser, so it proves which app is calling, never who. Every project route checks that you are a member, and a stranger gets a 404.

A test walks every route and fails on one without a signed-in user, unless a written reason sits beside it.

backend/tests/test_route_auth_boundaries.py
UNGATED: dict[str, str] = {    # Public catalogue reads. These describe what Duct *can* do, not what any    # account has done, so they leak nothing about a user. All are behind    # validate_api_key, which keeps them off the open internet.    "GET /api/engines/status": "capability catalogue; reports presence, never a key",    "GET /api/engines/thinking": "static catalogue of thinking levels per model",    "GET /api/insights/modes": "static list of insight modes",    "GET /api/models/catalogue": "static model catalogue",

Your keys, your choice of model.

Bring a key from Anthropic, OpenAI, Google, xAI or OpenRouter, or run a local model. You pick three models; Duct decides which job needs which.

The desktop app keeps your keys in the OS keychain. For no Duct servers at all, the self-host build runs the whole backend on your machine.

backend/agents/tiers.py
JOB_TIER: dict[Job, Tier] = {    Job.ANALYSIS:     Tier.HEAVY,    Job.AUDIT:        Tier.HEAVY,    Job.VERIFICATION: Tier.STANDARD,    Job.SYNTHESIS:    Tier.STANDARD,    Job.DRAFTING:     Tier.STANDARD,    Job.CHAT:         Tier.STANDARD,    Job.RESEARCH:     Tier.LIGHT,    Job.MEMORY:       Tier.LIGHT,    Job.RECAP:        Tier.LIGHT,}

Comments carry the why.

A comment that restates the line below it teaches people to skip comments. The ones worth writing name the threat, the failure or the option that lost.

In code agents help write, that reasoning is what the next change gets checked against. STYLE.md cites this one as the model.

backend/service/membership.py
# Length of the raw invitation token before URL-safe encoding. 32 bytes gives a# 43-character token — far past guessing range for a link that also expires._TOKEN_BYTES = 32

Agent-written pull requests are welcome.

The template asks where an agent helped, so the reviewer knows where to look hardest. Nothing is rejected for ticking it.

.github/PULL_REQUEST_TEMPLATE.md
## AI assistance<!-- Agent-written contributions are welcome. This is not a disclosure tax and     nothing is rejected for ticking it; it just tells the reviewer where to     look hardest, because agents and humans make different mistakes. -->- [ ] An AI coding agent wrote or substantially shaped this change- [ ] I have read every line of this diff and can explain why each part is there

Disagree with one? Say so in public.

Each of these is a default with a reason. If the reason is wrong, the reason should change.