Twin Me Up

io.github.GitDakky由 GitHub 账号 GitDakky 发布v0.2.1更新于 Oct 27, 2026

A personal work twin for every AI agent: your confirmed guidance and explicit grants, enforced.

概览

AI 生成的概览

本地“工作分身”服务器:向 AI 代理传达你已确认的准则,判断某项操作是否获授权,并把审批请求留给你本人决定。

可以做什么
  • 向代理提供某工作流下你已确认的准则、边界与当前授权,并可检索这些准则
  • 判断某个具体操作是否被允许,为单个操作发起审批请求,并查询审批状态
  • 记录决策、纠正意见与候选经验,并列出等待你审核的未确认经验
  • 查看某工作流的成效记录,以及针对已记录决策值得追问的问题
适用场景
适合同时使用多个 AI 代理、却要反复向每个代理重复相同偏好、红线与审批习惯的人。也适合希望把已确认准则和明确、可过期的授权集中保存在本地,并让重要操作先征求你同意而非被默默执行的场景。
运行要求
需要 Python 3.11 或更高版本,以及 uv 或 pipx;macOS 与 Linux 已测试,Windows 未测试。先在你自己的终端运行 twinmeup init 设置姓名和口令,再用 uvx twin-me-up 启动服务器。数据默认存放在 ~/.twinmeup,可用 TWINMEUP_HOME 更改。无需账号或 API 密钥,只有可选的评测运行会调用模型。
安装前请注意
口令用于确认经验、授予权限、审批请求、导出与删除,切勿交给代理。没有前置钩子时该服务器只是建议性质,代理可以无视;审批也只是限时而非一次性。授权不等于沙箱,文件仅限本人可读但未加密。写入重试只有带上 request_id 才不会重复记录。

安装

在 SourceWeft 中

  1. 打开 控制台中的 Twin Me Up,将其添加到工作区。
  2. 为需要使用其工具的对话启用该服务。

Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。

其他 MCP 客户端

参照 仓库 中的启动说明。

README

[Twin Me Up: a personal work twin for every AI agent]

[PyPI] [Python versions] [CI] [OpenSSF Scorecard] [Licence: Apache-2.0] [Model Context Protocol]

Teach it once. Every agent you use works the way you would, and asks before it acts.

Quick start · One-prompt install · How it works · Works with · The research · Safety

[Installing Twin Me Up, then an agent being briefed, asking before it sends an email, and being stopped from pushing code it was not authorised to push]

Why

You probably use more than one AI agent. Each one starts from zero. It does not know what you care about, which corners you never cut, or which decisions you always want to make yourself. So you repeat yourself, correct the same mistakes, and hope nothing consequential happens before you look.

Twin Me Up is a small, local, open-source service that gives every agent the same answers to three questions:

  1. How does this person want this kind of work done? Your confirmed guidance, criteria, exceptions and red lines, briefed to the agent at the start of work.
  2. Am I allowed to do this? Explicit grants, scoped to a workflow and a set of actions, with optional expiry. Anything not granted returns ask. Optional hooks enforce that outside the model.
  3. What did I just learn? Your decisions and corrections become candidate lessons. Only you can confirm them.

It is not a chatbot of you, a personality clone or an autonomous replacement for you. The evidence does not support those claims, and the research explains why.

What makes it different

Learning you ratifyAgents propose lessons. Only you confirm, revise, reject or retire them. Every lesson keeps its origin, sources and history.
Authority you grantAgents act on explicit grants for a workflow and named actions, optionally expiring. Actions in the reserved twin. namespace can never be granted to anyone.
Enforcement outside the modelPre-action hooks for Hermes, Claude Code and pi block or escalate ungranted tool calls. They fail closed.
Evidence, not vibesFreeze held-out decisions, then test the twin against a generic assistant and a rules-only baseline. Results come with sample-size warnings.
One twin, every agentOne MCP server, a native pi extension, a CLI bridge and function-calling schemas. Thirteen agent systems and frameworks documented, ten verified live.
YoursLocal SQLite with owner-only files, a tamper-evident audit log, portable export, and erasure that removes everything derived from a record. No telemetry.

Compared with what you might use today

A rules file or system promptBuilt-in agent memoryTwin Me Up
Works across every agent you useCopied into each oneWithin one productOne twin, over MCP
Learns from your correctionsNoOften, automaticallyYes, as proposals
You approve what it learnsYou write all of itUsually after the factAlways, before it counts
Stops actions you have not allowedNoNoYes: grants, ask and hooks
Shows whether it actually helpsNoNoHeld-out tests against baselines
Where your data livesYour filesThe vendorYour machine

Quick start

You need Python 3.11 or later and uv (or pipx). macOS and Linux are tested. Windows should work but is untested.

bash
uv tool install twin-me-up        # or: pipx install twin-me-uptwinmeup init                     # your name and a passphrase, in your own terminaltwinmeup connect --list           # every supported agent systemtwinmeup connect claude-code      # the exact steps for one of them, with your pathstwinmeup doctor                   # check everything, including a live MCP handshake

twinmeup init asks for your name and a passphrase. The passphrase guards everything only you should do: confirming lessons, granting authority, exporting and erasing. Agents are never given it, and those commands refuse to run without it.

Only need the MCP server? After twinmeup init, any MCP client can start it with uvx twin-me-up. Prefer the latest code? uv tool install git+https://github.com/GitDakky/twin-me-up.

Upgrading? Run uv tool upgrade twin-me-up (or pipx upgrade twin-me-up), then twinmeup doctor. The FAQ explains what an upgrade changes for your twin.

Using Claude Desktop? After twinmeup init, download the .mcpb desktop extension from the latest release and open it. One bundle works on macOS, Windows and Linux.

Install with one prompt

Already working inside an agent? Paste this into it.

Copy-paste install prompt
text
Install Twin Me Up for me and connect it to yourself. Twin Me Up is a local, open-sourcework twin: it learns how I make decisions, briefs you at the start of work and tells you whenyou need my approval. Repository: https://github.com/GitDakky/twin-me-up
Work step by step and show me each command you run.
1. Install it. Prefer uv:     uv tool install twin-me-up   If uv is not available, use pipx:     pipx install twin-me-up   If PyPI cannot be reached, install from GitHub instead:     uv tool install git+https://github.com/GitDakky/twin-me-up   Then check with: twinmeup version
2. Ask me to run `twinmeup init` myself, in my own terminal, and wait until I say it is done.   It sets my name and a passphrase that only I know. Do not run it for me, do not ask me for   the passphrase, and never type a passphrase anywhere.
3. Run `twinmeup connect --list`, pick the entry that matches you (or `generic`), then run   `twinmeup connect <entry>` and carry out the steps it prints to register the MCP server and   install the skill. If it offers optional enforcement hooks, show me the action map and the   hook configuration first, and install them only if I agree.
4. Run `twinmeup doctor` and report the result.
5. If your system needs a new session to load MCP tools, tell me. Otherwise call twin_brief   for workflow "general" and summarise what it says.
While you work with my twin:- Call twin_brief at the start of a piece of work.- Call twin_authorise before anything consequential: sending, paying, publishing, deleting or  committing on my behalf. If the answer is "ask", prepare a draft, request my approval with  twin_request_approval, and act only once twin_approval_status says it is approved.- Give every write a request_id, so a retry never records anything twice.- When I correct you, record it with twin_record_correction.- Never try to confirm lessons, approve requests, grant authority, export or erase. Those are  mine, and the twin will refuse you anyway.

The agent installs the package, connects itself and checks the result. The two steps that matter stay with you: choosing the passphrase, and approving any enforcement hooks. The prompt is also in docs/install-prompt.md.

How it works

mermaid
flowchart LR    you([You])    twin[("Your twin<br/>local store")]    agent["Any agent"]    hook{{"Pre-action hook"}}    you -- "confirm lessons<br/>grant and approve" --> twin    twin -- "candidate lessons<br/>to review" --> you    agent -- "twin_brief<br/>twin_authorise<br/>request approval" --> twin    agent -- "record decisions<br/>and corrections" --> twin    agent -. "every governed tool call" .-> hook    hook -- "ungranted: block or ask" --> agent    hook -- "checks grants" --> twin

The loop

  1. Orient. At the start of work the agent calls twin_brief. It gets your confirmed guidance for the workflow, with boundaries and escalation rules always included, and a list of what it is authorised to do.
  2. Check. Before anything consequential it calls twin_authorise. The answer is allow only when a live grant covers the action. Otherwise it is ask: the agent prepares a draft, requests your approval and waits for your decision.
  3. Learn. When you make a decision or correct the agent, it records the decision or the correction and proposes lessons from it.
  4. Ratify. You review the queue and confirm, revise or reject each lesson. Only confirmed lessons reach future briefs.
  5. Prove. You freeze held-out decisions and test the twin against two baselines before trusting it with more.

Tools your agents get

ToolWhat it does
twin_briefYour confirmed guidance and current authority for a workflow. Call it at the start of work.
twin_authoriseMay I do this now? Returns allow with the covering grant, or ask.
twin_request_approvalAsk you to approve one action. You decide in your own terminal.
twin_approval_statusHas the request been approved, declined or not yet decided?
twin_searchFind confirmed guidance relevant to a question.
twin_review_queueUnconfirmed lessons to show you for review.
twin_track_recordEvidence and stage for a workflow: learning, corrections, evaluations and grants.
twin_next_questionsThe most valuable unanswered questions about a recorded decision.
twin_record_decisionCapture a real decision: situation, options, choice, reasons.
twin_amend_decisionMerge your answers to follow-up questions into a recorded decision.
twin_record_correctionRecord when you edit, override or reject the agent's work.
twin_propose_lessonPropose a lesson. It has no authority until you confirm it.

What only you can do

These commands need your passphrase, so agents cannot run them.

CommandPurpose
twinmeup initSet your name and passphrase
twinmeup lesson confirm, reject, revise, retireDecide what your twin has learned
twinmeup grant add, revokeGive or withdraw authority
twinmeup approvals approve, declineDecide what agents have asked to do
twinmeup eval create, add-case, from-episode, freezeBuild held-out evaluation sets
twinmeup exportWrite a portable bundle of your twin
twinmeup erase episodeErase a decision and everything derived from it

Approvals

An agent that needs an action it has not been granted asks for it, then waits:

  1. twin_authorise says ask. The agent prepares a draft and calls twin_request_approval with a one-line summary of what and why.
  2. You see the request with twinmeup approvals list and decide in your own terminal: twinmeup approvals approve <id>, or twinmeup approvals decline <id> --note "why".
  3. The agent checks twin_approval_status and acts only once it says approved.

An approval grants exactly the action requested, once and for an hour, unless you say otherwise (--uses 3, --for 1d). Where a hook enforces, the tool call that acts spends it, so another attempt needs another request. Every approval and decline is also recorded as a decision, so your twin learns where your lines are. Requests survive restarts, and an agent that asks twice gets its first request back.

Write tools also take an optional request_id. A retry with the same id, after a dropped connection or a crash, returns the first result instead of recording twice.

Works with

twinmeup connect <system> prints the exact steps for each of these, using the paths on your machine. All the guides are also in docs/integrations.md.

SystemHow it connectsVerified live
Hermes AgentMCP server, skill, pre_tool_call hookConnected, all tools discovered
piNative extension: brief injection, tools, enforcementBrief injected, tool called, git push blocked
Claude CodeMCP server, skill, PreToolUse hookConnected
OpenAI Codex CLIMCP serverConfiguration accepted
Gemini CLIMCP serverConnected
Cursor and Cursor AgentMCP serverAll tools listed
OpenCodeMCP serverConnected
Pi Durable 1.2.0Extension (experimental)Ungranted push blocked; one approval allowed exactly one push; a wait survived a crash and restart
VS Code (Copilot agent mode)MCP serverDocumented, not yet run
GooseMCP extensionDocumented, not yet run
Microsoft Agent FrameworkMCP stdio toolTools listed and called
OpenAI Agents SDKMCP stdio serverTools listed and called
LangChain and LangGraphlangchain-mcp-adaptersTools listed and called
Anything elseMCP, or OpenAI and Anthropic function schemas with a CLI bridge

Checked in October 2026 against current releases. The host checks ran on 0.1.0; 0.2.0 adds two tools to the same MCP server, and the Pi Durable check ran on 0.2.0. The framework checks are reproducible with scripts/interop/frameworks.py. Got it working somewhere marked "not yet run"? Tell us how.

No MCP? Export function-calling schemas and dispatch calls through the CLI:

bash
twinmeup tools schema --format openai > twin-tools.jsontwinmeup --actor agent:my-bot tools call twin_authorise '{"workflow": "general", "action": "email.send"}'

Teach your twin

Start small: one workflow you repeat often, such as reviewing quotes or triaging requests.

1. Write down the red lines. These are carried into every brief and never ranked out.

bash
twinmeup probes onboarding      # questions worth answering for a new workflowtwinmeup lesson propose --workflow quote-review --kind boundary \  --statement "Never instruct a contractor without my written approval." \  --origin written_rule --confirm

2. Record real decisions. Agents do this with twin_record_decision as you work. You can also add them yourself from JSON (see examples/); records you add yourself ask for your passphrase, because they carry your name.

bash
twinmeup episode add examples/episode.quote-review.jsontwinmeup episode gaps <episode-id>      # what the record does not yet explain

3. Review what it proposes. Nothing an agent proposes has authority until you say so.

bash
twinmeup lesson list --status candidatetwinmeup lesson confirm <lesson-id> --note "Yes, always"twinmeup lesson revise <lesson-id> --statement "Only for quotes over budget"

4. Grant authority narrowly, and let it expire.

bash
twinmeup grant add --workflow quote-review --action draft.prepare --expires 2026-12-31twinmeup grant list

Lessons come in seven kinds: fact, criterion, exception, escalation, procedure, boundary and preference. Each records whether it was a written rule, elicited from you, inferred by a model or learned from a correction.

Measure it

Do not trust a twin because it sounds like you. Test it on decisions it has not seen.

bash
twinmeup eval create --name holdout --workflow quote-reviewtwinmeup eval from-episode <set-id> <episode-id>     # or: eval add-case <set-id> case.jsontwinmeup eval freeze <set-id>
export OPENROUTER_API_KEY=...                         # or use endpoint: with a local modelfor arm in generic rules twin; do  twinmeup --actor agent:eval eval run <set-id> --arm $arm --responder openrouter:<model>donetwinmeup eval report <run-id>

Each case is answered three ways with the same model:

ArmWhat the model is given
genericThe task and the options
rulesPlus the rules you wrote down explicitly
twinPlus everything you have confirmed and your past decisions, excluding held-out cases

The twin has earned its keep only if it beats the rules arm. Reports show agreement with your choices and how often the twin correctly escalated, with warnings when the sample is too small to mean much. twin_track_record moves a workflow from observe to draft to supervised as evidence accumulates. A stage is advice, not authority: more autonomy still needs an explicit grant from you.

docs/pilot-guide.md describes a six-week pilot for one workflow.

Safety model

  • Human-only operations need your passphrase. It is stored as a salted scrypt hash and read from your terminal, never from an agent's arguments.
  • Agents cannot set themselves up as you. Setting up an unprotected twin has to be done from a real terminal.
  • Reserved actions. Anything under twin. can never be granted, so no grant can hand an agent control of the twin itself.
  • Approvals cover one action, once. Only you can approve or decline, with your passphrase. An approval grants exactly the action requested, for one use and an hour unless you say otherwise. Where a hook enforces, every tool call is a new attempt, so an id a host reuses cannot ride on a spent approval.
  • Enforcement fails closed. If a hook cannot reach a decision, the tool call is blocked. The example action maps also stop agents running human-only commands, writing to the twin's store or editing the host configuration that registers the hook.
  • Tamper-evident audit. Every write is appended to a hash chain. twinmeup audit verify checks it.
  • Signed, reproducible releases. Packages are built in GitHub Actions and published to PyPI with trusted publishing and attestations. No long-lived tokens exist.
  • Honest limits. Twin Me Up runs as you. Any program running as your user can read your files. The passphrase stops agents using the twin's own commands to act as you, and hooks stop governed tool calls, but neither is a sandbox. For hard isolation, run agents as a different user or in a container.

See SECURITY.md for the threat model and how to report a vulnerability.

Where it can still fail

Twin Me Up narrows what agents may do. It does not make an agent safe on its own.

  • Without a hook, the twin advises. Over MCP alone it tells an agent what it may do, and nothing stops an agent that ignores it. Enforcement needs a pre-action hook: Hermes, Claude Code, Cursor, pi or Pi Durable.
  • Hooks govern only mapped calls. A tool or command your action map does not match is left to the host's own permissions.
  • Without a hook, an approval is time-boxed, not single-use. The hook is what spends it, so over MCP alone an approved action stays allowed until it expires.
  • A grant is not a sandbox. An allowed action runs with the agent's full permissions.
  • Retries are safe only with a request_id. A write retried without one can be recorded twice.
  • Your passphrase is the boundary. Anyone with it and your terminal can confirm lessons and approve requests. Agents never receive it, and a compromised machine is out of scope.
  • Files are private, not encrypted. The store and settings are readable only by your user account. Encryption at rest is not built in yet.
  • A prediction is not consent. The twin learns how you decide, and never treats a forecast of your answer as your approval.

Your data

  • Everything lives in ~/.twinmeup (set TWINMEUP_HOME to move it). Files are readable by you only.
  • twinmeup export twin.bundle.json writes a portable bundle. Held-out evaluation answers stay sealed unless you ask for them.
  • twinmeup erase episode <id> --reason "..." removes a decision and every lesson, handoff and evaluation case derived from it, and redacts it from the audit log while keeping the chain valid.
  • The twin itself never calls a model and sends nothing anywhere. The only network calls are the evaluation responders you choose to configure.

The research

Before writing code we reviewed the primary research on digital twins of people, expertise transfer and AI assistance. The headline results:

FindingSource
Interview-based agents reach 65.67% raw accuracy on held-out survey items, against 79.53% consistency for the people themselvesPark et al., arXiv:2411.10109v3
Predicting an individual's own new answers is far harder: 0.300 exact accuracy against 0.446 for the same people answering twicearXiv:2603.29890v1
Experts described 44% of a procedure's steps unprompted and 66% when promptedPubMed 24667500
AI assistance raised productivity by 15% on average, with large differences between workersarXiv:2304.11771v2
Unrestricted AI assistance left students 17% below control once it was removedPNAS, Bastani et al.

That is why the twin never infers authority, why learning needs your confirmation, why it asks follow-up questions about omitted reasons, and why it is tested against baselines instead of trusted on feel. The full review, with every source and the regulatory lines it draws (including the EU AI Act's prohibition on workplace emotion inference), is in docs/research.md.

Command reference

All commands
CommandPurpose
twinmeup initSet up your twin: your name and your passphrase
twinmeup doctorCheck settings, passphrase, store, audit chain and a live MCP handshake
twinmeup versionThe installed version
twinmeup statusRecord counts and audit-chain health
twinmeup connect <system>Exact steps to connect an agent system (--list for all)
twinmeup briefThe operating instructions an agent embeds in its prompt
twinmeup handoffA handoff packet for a receiving agent or colleague
twinmeup authoriseCheck authority; exits 0 when allowed and 3 when approval is needed
twinmeup episode add, amend, list, show, gapsRecorded decisions
twinmeup lesson propose, list, confirm, reject, revise, retire, historyLearned guidance
twinmeup grant add, list, revokeAuthority
twinmeup approvals list, show, approve, declineRequests from agents; approve and decline are human only
twinmeup eval create, add-case, from-episode, freeze, list, run, reportHeld-out evaluation
twinmeup probes onboardingInterview questions for a new workflow
twinmeup tools list, schema, callThe agent protocol without MCP
twinmeup hook pre-tool-callEnforcement for host hooks
twinmeup action-map example, matcher, checkBuild and test enforcement maps
twinmeup skill export, showThe agent skill that teaches the loop
twinmeup extension export pi, pi-durableNative extensions for pi and Pi Durable (experimental)
twinmeup audit verify, logThe tamper-evident audit log
twinmeup exportPortable bundle (human only)
twinmeup erase episodeErasure with derived records (human only)
twin-me-upThe MCP server for uvx twin-me-up. Given a command, the same as twinmeup

Every command has --help. Global options: --home, --actor, --principal and --passphrase-stdin (for scripts you run yourself).

FAQ

Does Twin Me Up need an LLM?

No. The twin is deterministic: storage, retrieval, authority and audit. Your agents bring the model. Only eval run with a model responder calls one.

Is this a clone of me?

No. It holds the guidance you have confirmed and the decisions you have recorded, and it tells agents what they may do. It does not imitate your voice or personality, and it does not model emotions.

What if an agent ignores the twin?

Without hooks the twin is advisory: well-behaved agents follow the skill, but nothing forces them. With hooks (Hermes, Claude Code and pi) or the Pi Durable extension, governed tool calls are checked outside the model, and ungranted ones are blocked or wait for your approval.

Can I use it at work?

Yes, as your own tool. If an organisation deploys twins for its staff, it needs its own assessment of lawful basis, notices and retention, and clear rules on who owns and can revoke each twin. Consent is rarely a sound basis for workplace monitoring. See docs/research.md.

Do I type twinmeup or twin-me-up?

Either. twinmeup is the CLI. twin-me-up is the package's own name: given a command, such as twin-me-up doctor, it does the same as twinmeup. With no command it starts the MCP server, which is what agent hosts and uvx twin-me-up run.

How do I upgrade?

Run uv tool upgrade twin-me-up, or pipx upgrade twin-me-up. If uv says there is nothing to upgrade just after a release, it is reading a cached index: run uv cache clean twin-me-up and try again. A newer version moves your twin to its store format the first time it opens it, and older versions cannot open it after that. Check with twinmeup version and twinmeup doctor.

Can several people share a machine?

Give each person their own TWINMEUP_HOME. One twin belongs to one person.

Roadmap

  • Enforcement hooks for more hosts as their hook interfaces allow
  • Encryption at rest for the store
  • Signed bundles for moving a twin between machines
  • A small local review app for lessons and approvals
  • Verified guides for VS Code, Goose and Windows
  • The Pi Durable extension out of experimental, with a verified map for pi's coding tools

Follow along, or pick something up, in issues and discussions.

Contributing

Contributions are very welcome, from a typo fix to a new agent integration. Good first issues are a gentle start, and CONTRIBUTING.md explains the setup, the one-command check and how reviews work. Please report security issues privately, as described in SECURITY.md.

Credit and licence

Twin Me Up was created by GitDakky and is released under the Apache License 2.0. If you redistribute it or build on it, the licence requires you to keep the NOTICE file, which credits the original author. Using it in research? GitHub's "Cite this repository" button gives you a ready-made citation.

If Twin Me Up is useful to you, a star helps other people find it.

[Star history]

Built on the Model Context Protocol.

来源:README.md,提交 7d1113c

工具

0
SourceWeft 尚未在沙箱中启动过该软件包,因此其工具未知。

版本历史

3
  1. v0.2.1最新Oct 15, 2026
  2. v0.2.0Oct 15, 2026
  3. v0.1.0Oct 14, 2026

评分

已满足适用检查项的 50%

该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。

  • 近 30 天内可连通25 分

    请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。

  • 已声明认证方式10 分

    请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。

  • 已列出工具15 分

    请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。

  • 描述必需15 分
  • 图标10 分
  • 文档15 分
  • 许可证10 分