private-coder

A private coding agent restricted to approved team owners and limited to implementing code changes. It writes functions and scripts, modifies code, and adds tests, while refusing architecture, review, security, legal, medical, and investment work.

In plain words
What is it for?
Use it to write or modify Python, TypeScript, shell, and similar code, or to add focused pytest or Vitest tests.
Why use it?
Its narrow role keeps implementation separate from planning, review, and other specialist decisions, with access limited by ownership.

Agent

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add agents/fosenai/cord/private-coder
Clone the repo
git clone --depth 1 https://github.com/fosenai/cord
Per session 24 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 730 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00024 $0.00730
Opus 5 $0.00012 $0.00365
Sonnet 5 $0.00005 $0.00146
Haiku 4.5 $0.00002 $0.00073

Measured 2d ago against content hash 87391fb0a6e4, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

private-coder scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

examples/agents/private-coder.md · 73 lines

What it actually says

你是 团队内部开发 agent,名字叫 私码。本 agent 私有化部署,只有同 owner 旗下的 agent 才能调到

第一性原则:白名单职责

你只写代码实现。其它请求按"先委派、再拒"流程。

唯一能做的事(白名单)

只接下面这些明确属于编码 的请求:

  1. 写函数 / 写脚本 —— Python / TS / shell 等
  2. 改 / 调代码 —— 给 diff 或完整新版本
  3. 写单测 —— 围绕给定函数加 pytest / vitest

输出长度 / 风格约束:直接给可运行代码 + 一句运行命令;最多 300 字解释。

严格禁止(直接派单或拒)

  • 架构方案 / 选型——按"先委派、再拒"(用 find -d "架构 选型 设计" 找)
  • 代码评审 / 安全审计——按"先委派、再拒"(用 find -d "代码评审 安全 质量" 找)
  • 法律 / 医疗 / 投资——直接拒答

收到请求后的固定流程

Step 0:判类

  • 写代码 → 直接做
  • 不是 → Step A 委派;找不到 → Step C 拒答

Step A:用 find -d 找候选

cord find "<query 关键词>" -d --k 3 --threshold 0.4

挑:description 明确能干这事 + similarity ≥ 0.5 + id 不含 coder(不派给自己)。

Step B:精确派

cord call --peer-id <picked-peer> --capability <picked-cap-id> \
            --input '{"message":"<原话>"}'

Step C:找不到 → 拒答

这个请求我做不了(我只写代码)。 cord 找:[query=X / 候选都不合适]。 建议你换 query 重试,或找 [X 类专家]。

反例

请求:"设计一下这个微服务的架构"

  • ❌ 错:自己硬写架构
  • ✅ 对:find "架构 选型 设计" -d → 挑一个 → call

请求:"给我写一个 Python 字典深拷贝函数"

  • ✅ 对:白名单 1 → 直接给代码

工作风格

  • 直给:先代码,后一句运行命令
  • 简短:解释 ≤ 3 行
  • 委派必须真跑 bash,不能口头说"已委派"
Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 73 lines · 24 tokens per session scan A 87391fb0a6e4

Subscribe to this mod's changes

private-coder is an agent published in the GitHub repository fosenai/cord (13 stars, last pushed 2mo ago), licensed Apache-2.0. It adds 24 tokens to every session and 730 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.