This release is a pre-release and may not be stable for production use.
DoppelCode - a private twin of your code for AI agents
Version: 0.7.0b13 (public beta)
Date: 2026-12-03
DoppelCode lets you use AI coding agents on proprietary code while reducing what an AI sees of your code. It
writes a twin of your project: the same code with your names and file names replaced by placeholders.
By default, comments are hidden in source, build and script files (comments: hide) and names are replaced
inside strings (strings: scrub); strings: hide replaces whole strings too. Optionally your tuned constants are hidden and your
core function bodies left out. The AI works only on the twin. doppel import merges its edits back into
your original with the real names, and DoppelCode records what was sent to the AI, so you can show later
which parts of your code an AI was given.
Python 3.11+, no third-party packages. Optional: gcc/g++ or clang (header harvesting, compile check), git (3-way merge).
Who it is for
- "My client's contract does not allow sending their code to an AI service."
- "I work in a regulated industry, and I have to show what left the company."
- "Our code names and customer names must not leave the company."
- "I want an AI agent's help without handing it our product, people or customers by name."
What the AI sees, and what it does not:
- Not seen: your identifiers and file names (replaced by placeholders), comments (hidden by default), names
inside strings (or whole strings, with
strings: hide), text your program prints (hide_output_strings), the values you mark secret, and the bodies of functions you withhold. - Still seen: the structure and the algorithms - function signatures, control flow, data layout, well-known library calls. A capable model can often tell what the code does; DoppelCode hides who it belongs to and what it is called, not how it works.
- DoppelCode makes no claim about what an AI provider does with what it receives; it reduces what is sent, and
checkand the exposure ledger show what that was.
Quick Start (5 minutes)
pip install doppelcode # installs the doppel command (or: python -m doppelcode ...)
pip install . # or: install from source, in a clone of this repo
doppel init path/to/project # optional: writes .doppel/config.json with the defaults
doppel export path/to/project --out path/to/twin # writes the twin
On Windows, pip may say The script doppel.exe is installed in '...\Scripts' which is not on PATH. Then
doppel is not found: add that folder to your user Path (Settings > System > About > Advanced system
settings > Environment Variables; open a new terminal afterwards), or run every command as
py -m doppelcode ... instead of doppel .... The VS Code extension uses py -m doppelcode by itself
when doppel is not found.
- Open the twin folder, not the original, in your agent (Claude Code, GitHub Copilot agent, Cursor,
or paste it into a chat). The twin has an
AGENTS.md/CLAUDE.mdthat tells the agent the rules. - Let the agent work in the twin as usual.
doppel import path/to/projectmerges the agent's changes into your original, with your names.doppel check path/to/projectverifies the round trip, scans the twin for leaks and compiles both versions (C / C++ machine code is compared; Python syntax trees are compared).doppel report path/to/projectshows which function bodies were made available to an AI, and when.
Protection Levels
| Level | What the AI sees | Config |
|---|---|---|
| Names only | your code with names and file names replaced; comments hidden in source, build and script files; names replaced inside strings (scrub); with strings: hide, whole strings replaced |
default comments: hide, strings: scrub, build_names: rename |
| + secret constants | tuned values and tables replaced by K_ aliases with dummy values |
secret_symbols, secret_values, secret_files |
| + withheld functions | the signature only; the body stays on your PC | core_functions, core_modules |
Pilot results (DeepSeek, DeepThink on; two small projects, one in C and one in Python; one chat per project and condition). The attack question asked for every value and whether the core functions could be rebuilt:
| Round | Protection | Values recovered | "Can rebuild the core functions" | Tasks done automatically |
|---|---|---|---|---|
| 2 | Names only | all, in both projects | yes | 6 of 6 |
| 2 | + secrets + withheld | 4 of 16 tones, 3 of 4 symbols (from test code); one unmarked pair | no | 4 of 6 (the 2 others were changes inside withheld bodies, done by the owner) |
| 4 | + secrets + withheld (after the round 2 fixes) | none | no | 3 of 6, 1 partly right, 2 change requests in plain words |
These are small pilots with one model; they show the direction, not a guarantee.
The defaults and the trade-off (0.7.0b10)
| Setting | Default | Why | To change |
|---|---|---|---|
comments |
hide |
comments often say what the code is for, who wrote it and for whom; hiding them (in source, build and script files) does not change how the twin builds or runs | "comments": "scrub" keeps comments with your names replaced (better AI answers, the comment text is visible to the AI) |
strings |
scrub |
strings are data: hiding them changes what the twin does at runtime (curl's twin no longer recognises its own options; 603 of librosa's 1,957 tests fail). An agent that runs tests in the twin would then "fix" failures that exist only there, and import would bring those edits back | "strings": "hide" for projects whose messages or keys are sensitive; the twin may then behave differently at runtime |
build_names |
rename |
Makefile and CMake targets and options made of your names (falcon_selftest) would tell the AI your names |
"build_names": "keep". With rename, the twin's build options are renamed too (-DCURL_USE_LIBPSL=OFF is -Dw_0688=OFF in the twin): doppel translate --to-twin translates a configure command |
Configs written before 0.7.0b10 keep their values; doppel init prints how to switch.
Languages
| Language | Files | What is renamed | Library names kept by | Verified by check |
|---|---|---|---|---|
| C | .c .h |
every identifier | system headers the code includes | compile + machine code |
| C++ | .cpp .cc .cxx .hpp .hh ... |
every identifier | system / STL headers (via g++) | compile + machine code |
| Python | .py .pyw .pyi |
names the project declares | public names of imported modules (read, never run), builtins | syntax trees |
| C# | .cs |
names the project declares | keyword / BCL lists, member rule | compile (csc) |
| Java | .java |
names the project declares | keyword / JDK lists, member rule | compile (javac) |
| JavaScript / TypeScript | .js .mjs .jsx .ts .tsx |
names the project declares | keyword / runtime lists, member rule | compile, syntax only (Node) |
For the "declared" languages, a name is kept when it is used as a member of something the project
does not declare (os.path, sb.Append, crypto.createHash), when it is imported from an outside
module, when it is a keyword argument to a library call (json.dumps(indent=2)), or when it is a
method of a class derived from a library class (unittest setUp, Thread.run). Python packages
(folders with __init__.py) are renamed together with their imports; Java files take their public
class's new name. Code inside f"{x}", $"{x}" and `${x}` is always translated, strings that
name code (getattr(o, "x"), __all__, obj["x"], reflection) are renamed with it, and module
names (require("crypto"), import ... from "lib") are never hidden.
Machine code is compared against a names-only version of the twin (strings and comments untouched),
so the comparison proves that renaming changed no code whatever the string policy. With strings set
to keep, a Python twin prints exactly what the original prints.
check also builds Java, C# and JS / TS. The original is built first; if it does not build with the
tool found, its files are listed as NOT CHECKED with the reason, so only errors the twin alone has
count. The twin's code is never run (javac without annotation processors, csc without analyzers,
JS / TS only compiled). Tools are found automatically and can be set in .doppel/config.json:
| Key | Default search |
|---|---|
javac |
PATH, JAVA_HOME, ~/.jdks, Program Files JDKs, Android Studio's jbr |
csc |
Visual Studio Roslyn, .NET SDK, then the .NET Framework csc (C# 5 only: install the .NET SDK for newer C#) |
node |
PATH, Program Files, then VS Code's built-in Node (TypeScript types are stripped by Node) |
With strings set to keep, file and folder names inside path strings (require("./falconRadio"),
fopen("rec_01.dat")) are still renamed, so the twin finds its renamed modules and data files.
Desktop app
A desktop app is planned for a later release. This beta is the doppel command line; everything below
works with it.
Workflow
python -m doppelcode init <project> # optional: write .doppel/config.json to tune policies
python -m doppelcode export <project> [--out DIR] # create/refresh the twin (default <parent>/twin_<hash>)
... point the AI agent at the twin folder, let it edit ...
python -m doppelcode import <project> # merge the AI's changes into the original
python -m doppelcode check <project> --objects # round trip, leak scan, compile + machine-code compare
python -m doppelcode lookup <project> fn_0005 # translate a name either way
python -m doppelcode translate <project> --to-twin # a request to the AI, in real names (stdin)
python -m doppelcode translate <project> --to-original # the AI's reply, back to the real names
import performs a 3-way merge per file: the AI's changes are applied even if you edited the
original in the meantime. Only overlapping edits produce <file>.doppel-merge (with conflict
markers; the original is left untouched). export refuses to run until those are resolved.
init writes the defaults, with your OS user name and git user.name (and its words) as
sensitive_terms, so check reports them anywhere in the twin. A term under 4 letters (a user name
ted) is matched as a whole word only, so it does not flag "tested"; init lists such terms. Longer
terms match inside words too. An existing config is not changed.
Where the twin is, and copied or moved projects
A .doppel folder from someone else (a copied or cloned project) is not trusted: DoppelCode runs the tools its config names, and writes to a twin folder its config or vault names, only after you confirm them once on your computer with doppel trust <project> (0.7.0b13). Read what it prints before you confirm. The twin folder must be new, empty or this project's own twin.
The twin goes where --out says, or twin_dir in the config, or into twin_root as twin_<hash>, or else to the
folder the last export used, or else next to the project as twin_<hash> (before 0.7.0b9 the default name was
obf_<hash>; an obf_<hash> folder from before is still used).
| Key | Means | Example |
|---|---|---|
twin_dir |
the exact twin folder | "twin_dir": "C:\\doppel-twins\\falcon_twin" |
twin_root |
a parent folder; the twin is twin_<hash> inside it |
"twin_root": "C:\\doppel-twins" |
Use one of them. With both, twin_dir wins and export says so; init --twin-root removes twin_dir. Since b12 the
config always wins over the folder an earlier export used: when you set or change either key, the next export
writes the twin there ("moved: from ") and leaves the old twin alone; delete it yourself. Text such as "null" or an empty value counts as not set
(write null without quotes). The twin never goes inside the project, nor the project inside the twin: export
stops. A folder that
does not exist is created ("created:
What export lists (b12): files that left the twin since the last export ("removed from twin: Makefile", for a
file added to ignore) and files new in the twin ("new in twin: src/main.h"), so a file that should have been
excluded is noticed.
Config backups (b12). Every change DoppelCode makes to config.json keeps the old one as
.doppel/config.json.bak, and every doppel export keeps a copy of the config in a per-user folder
(~/.doppelcode/config_backups/<hash>.json, or DOPPELCODE_HOME; never in the twin, where the agent would read
your sensitive terms). After .doppel was deleted, doppel init warns "new config: exclusions and sensitive terms
are back to defaults" and, when it finds a previous config (also a .doppel.bak/config.json you kept), tells you to
run doppel init <project> --restore.
A neutral twin folder (0.7.0b11). The agent sees the twin's full path, and next to the project that path holds the names of the folders above it, which in a company often name a customer, a product or a team. Set a folder that says nothing, for all new twins of a project:
doppel init <project> --twin-root C:\doppel-twins # or "twin_root" in .doppel/config.json
The twin then goes to C:\doppel-twins\twin_<hash> (the hash says nothing about the project); a twin exported
before moves there with the next export. check prints a hint when the
twin's path holds one of your sensitive_terms or a part of the project's folder name. doppel init prints the same
tip until a twin_root is set; the default stays next to the project.
The vault also records the project's own path:
- Moved (the old folder is gone): the twin stays;
exportnotes the move. - Copied with its
.doppelfolder (the old folder still has its own): the copy must not use the other project's twin.importandcheckrefuse untilexporthas run in the copy, and thatexportwrites a new twin for it (twin_<hash>next to the copy, or--out) and leaves the other twin alone. A vault from before 0.7.0b9 has no recorded path: if its twin's default name belongs to another path,exportsays so; give such a copy its own twin with--out. - A project that has both
.doppeland an old.cobffolder uses the one with the vault (.doppelwhen both have one) and every command warns until you keep only one.
Review before applying (--preview)
python -m doppelcode import <project> --preview DIR # see what import would write
python -m doppelcode import <project> --from-preview DIR # apply all of it
python -m doppelcode import <project> --from-preview DIR --only src/a.c # or one file
--preview DIR runs the whole import, 3-way merge included, but writes the result to DIR at the same
relative paths (a conflict as <file>.doppel-merge) and prints the list of files. Nothing in the project,
the twin, the vault or .doppel/config.json changes. DIR must be outside the project and the twin, and
empty or an earlier preview (which is replaced). DIR/.doppel-preview.json records, per file, the twin
file and the original as they were.
--from-preview DIR applies exactly what was previewed, with the preview's --rename / --accept. It
refuses, and writes nothing, when a twin file or an original changed since the preview: preview again.
Applied files leave the manifest, so the rest can be applied later. The VS Code extension uses this for
its review view.
Rejecting the AI's changes (--discard, 0.7.0b12)
python -m doppelcode import <project> --discard --dry-run # list what would change
python -m doppelcode import <project> --discard # every change in the twin
python -m doppelcode import <project> --discard --only src/a.c # one file (project or twin path; repeat)
The twin goes back to how export wrote it (.doppel/twin_base): a file the AI changed or deleted gets that copy
back, after its hash is checked (a copy that changed since is refused and named); a file it created is deleted.
The project is never written. Run export afterwards to bring the twin up to date with the original.
Files that are not UTF-8, and line ends
DoppelCode keeps every file's bytes: a Windows-1255 or Windows-1252 file goes into the twin in its own
encoding (with comments: hide its comments do not go at all) and comes back the same, except the lines the
AI changed. An AI agent's editor often saves such a twin file as UTF-8 (replacement characters, or the code
page decoded). check finds a sensitive term with non-ASCII letters in such a file as in a UTF-8 file. Files in UTF-16 or UTF-32, or with NUL bytes, are not exported (export lists them: save them as UTF-8). Import gives every line whose only change is that re-encoding its original bytes back, and
writes the lines the AI did change in the file's code page when it can tell which one it is (encoding: in
the output). Line ends do not take part in the merge: the AI adding LF lines to a CRLF file, or your editor
saving the file again with one style, is not a change; changed lines take the original's style.
Writing to the AI in real names (translate)
python -m doppelcode translate <project> --to-twin [--text TEXT | --file FILE] [--json]
python -m doppelcode translate <project> --to-original [--text TEXT | --file FILE] [--json]
python -m doppelcode translate <project> --to-original --stream # a filter: stdin -> stdout, line by line
--to-twin translates a request you write with the project's real names to the names the AI sees in the
twin; --to-original translates the AI's reply back. The text comes from stdin unless --text or --file
gives it. Both read only .doppel and write nothing.
--to-original --stream is a filter for an AI agent's live output (the VS Code extension's Agent panel uses
it): it reads stdin line by line, writes each line translated as soon as it is complete (UTF-8, flushed
after every line, line ends kept) and exits with 0 when stdin ends. It prints no warnings.
- Whole identifiers only, case-sensitive:
sample_rate_hzis one name, neversample_rateplus_hz. - A name that is a plain English word (
block,key,state) is translated where the text is code (in backticks, in a code fence, or next to code punctuation such asblock[i],ctx->key,key(...)); in prose it stays a word, so "encrypt the first block" does not become "encrypt the v_0030 v_0008". - File paths, with
/or\, follow the twin (Utils/Utils_ReadWriteFile.c->Utils/mod_0001.c). - A withheld function becomes its
B_id; its body and purpose line are never used. - Back to the original: the same reverse translator as
import, so names the AI coined from a placeholder (fn_0005_checked) come back as import restores them,K_names show the real value andstr_/cmt_ids the real text. Placeholder-style names the vault does not know stay as they are, with a warning.
--to-twin warns, and never blocks, about: a sensitive term (sensitive_terms, the project folder name, the
OS user name, git user.name), a number or text equal to a secret constant's value, a word or phrase that is
part of a real name (Falcon, "sample rate"), an identifier-shaped word the vault does not know (it may be a
real name the twin does not cover), and a real file path (absolute, or a project file the twin does not have).
leak_allow silences a word. A single word of a real name that is also a common English word (round,
first, chain) is reported as information, not as a warning: almost every request has such words, so they
tell the AI little. A phrase that spells out a real name ("sample rate") stays a warning. Exit code 0 without
warnings (information alone included), 3 with warnings (on stderr as warning: and info: lines, or in the
JSON), 2 on an error. --json prints text, replacements (from, to, count) and warnings (kind,
severity (warning or info), text, position, line, column, length, detail) in ASCII.
Names the AI coins in DoppelCode's style
AI models often name new things like the placeholders they see (v_0048, fn_0017, "str_0013").
Mapped back blindly, a new parameter v_0048 would become an unrelated existing name
(fips_expected), and a new string "str_0013" would become an existing text ("ALL PASS").
On the lines the AI added or changed, import therefore flags:
- a known alias in a declaration position (function, parameter, local, field, type, macro) that the old version of the file did not declare;
- an alias-shaped name that is not in the vault (
fn_0017); - a string literal that is exactly
"str_NNNN"and was not in the old version of the file.
Plain uses of existing names map silently. Flagged files are not merged; the findings go to
the console and to .doppel/import_review.txt. Resolve them and import again:
python -m doppelcode import <project> --rename v_0048=nonce --rename fn_0017=falcon_ctr_crypt
python -m doppelcode import <project> --rename "str_0013=Decrypt failed"
python -m doppelcode import <project> --accept v_0017 # keep as written (known alias: its vault meaning)
python -m doppelcode import <project> --accept # accept every finding
A renamed name gets its own alias in the vault and the twin file is rewritten with it, so twin, vault and original agree from then on.
export also writes AGENTS.md and CLAUDE.md into the twin root (unless the project has its
own) asking the agent to give new things plain names, and a .doppel-twin marker, a small JSON file
("doppelcode": "twin") that tools such as the VS Code extension use to know a twin folder. The marker names
nothing of the project. import ignores all three files.
Example (samples/aes_project)
/* original */ /* twin */
void falcon_encrypt_block( void fn_0002(
const FalconAesContext *ctx, const T_0001 *v_0006,
uint8_t block[FALCON_BLOCK_SIZE]); uint8_t v_0008[M_0002]);
#include "falcon_aes.h" #include "mod_0001.h"
The names are gone, and with the default config the comments are hidden and the Makefile's falcon_selftest
target is renamed. The strings still say "Falcon", and check says so. Copy samples/aes_project somewhere first
(export writes .doppel into the project):
doppel export aes_project --out aes_twin
doppel check aes_project
round trip: OK
leaks: 3 line(s) - full list in ...\aes_project\.doppel\leaks.txt
by kind: name part 3
src/main.c:8: name part 'falcon' in Falcon
src/main.c:54: name part 'falcon' in FalconLinkKey01
src/main.c:55: name part 'falcon' in FalconInitVec01
3 line(s) of source files have parts of your names in strings ('scrub' keeps that text). Fix: "strings": "hide"
in .doppel/config.json, then export again (with strings hidden, the twin may behave differently at runtime); or
add words that may stay (a public product name) to "leak_allow".
name parts by word: 3 line(s) from 1 word(s): falcon (3)
Words that may stay (a public product name): add to .doppel/config.json:
"leak_allow": ["falcon"]
hints: name parts that are common or technical words, not counted as leaks: decrypt (2), encrypt (2), link (1)
compile: 2 C/C++ file(s), 0 twin-only error(s)
check exits with 1: the twin's strings still say "Falcon telemetry frame #42: altitude=1200m" and
"FalconLinkKey01". The fix: hide the strings, then export and check again:
doppel export aes_project --strings hide
doppel check aes_project
round trip: OK
leaks: none
compile: 2 C/C++ file(s), 0 twin-only error(s)
check exits with 0. The other way: list the words that may stay visible in leak_allow
("leak_allow": ["falcon"]); the strings then stay as they are. Words such as encrypt or link are common
technical words: check lists them as hints, not as leaks.
Secret constants
Renaming hides names, but in DSP or classifier code the numbers are often the real know-how:
thresholds, coefficients, tuning tables. Marked numbers are replaced in the twin by aliases
K_0001, K_0002, ...; the vault keeps the real values and import puts them back.
| Way to mark | Example | Hides |
|---|---|---|
| Line tag | x = 145 # doppel:secret |
every number on that line, or a table starting there as a whole |
secret_symbols |
["male_threshold", "lpc_order"] |
every number assigned to that name: assignments, self.x = ..., default values, keyword arguments (original names) |
secret_values |
["0.97", "3.3"] |
every number with that value: an integer mark "145" hides every form (145, 145.0, 0x91, 1.45e2); a float mark "3.0" hides 3.0, 3. and 3.0f but not the integer 3. Also inside strings and comments (even with keep) and in f-string code (f"{0.97 * x:.2f}"); format specifications such as "%.2f" and the .2f of {x:.2f} are never touched, JSON / dict text ({"gain": 0.97}) is not a format spec |
secret_files / secret_functions |
["dsp/"] / ["src/f.c::gate"] |
every secrets suggest candidate in these files / functions (values and table names; in a function only inside it) |
python -m doppelcode secrets suggest <project> [--all] [--top N] # ranked: tables, algorithm constants,
# thresholds, the rest (top 50 by default)
python -m doppelcode secrets list <project> [--show-values]
-
A marked value is hidden everywhere in the code (each place gets its own alias), and in comments and strings too when they are
scrubbed.checkfails if the value is still visible anywhere in the twin, also written as0x91,1.45e2or inside a string. -
0,1,-1,2and0.5are never hidden by value list (only at a tagged or named place), and never count as leaks. -
The twin still runs. A twin-only file gives every alias a neutral dummy value, and each file that uses one gets a marked line that
importremoves again:Language Dummy file (twin root) Line added to each file Python doppel_secrets.py:K_0001 = 1.0, tables[0] * nfrom doppel_secrets import K_... # DoppelCodeafter the importsC / C++ doppel_secrets.h:#define K_0001 (1.0f), tables{0, 0, ...}(same length)#include "../doppel_secrets.h" /* DoppelCode */after the first includeIn C a table initializer is replaced as a whole (
static const uint8_t k_rcon[10] = K_0001;, the size kept), and#define NAME 0x1bworks withsecret_symbolstoo. The dummy file is never imported; if the AI edits it, the import reports "secret value change requested" and keeps the real value. -
checkcompiles / parses the dummy twin, and compares the original with the twin with the real values put back (C: machine code, Python: syntax trees). -
If the AI replaces an alias by a literal (
K_0003->3.5), the file is not merged until you decide:--accept K_0003takes 3.5,--rename K_0003=@keepkeeps the secret,--rename K_0003=@secrettakes 3.5 and adds it tosecret_values. -
The elements of a secret table are hidden wherever else they are written in the same form (a test generator that hard-codes
400.0from the tone table), and in comments and strings in any form (400Hz). Small integers (-15..15) and powers of two stay visible: they are indexes, loop bounds, sizes and bit masks.doppel secrets suggestlists the functions that write such values - consider withholding them. -
Values computed from secrets (
145 * 2written as290) are out of scope.
Supported for Python, C and C++.
With withheld functions or secret constants set, strings defaults to hide (banners and help
texts would still tell the purpose); set "strings" in .doppel/config.json to choose otherwise.
One-word mode strings passed straight to a library call (filterwarnings("ignore"),
btype="band", encode("utf-8")) stay, so the twin still runs. Python dict keys are one class: in
scrub and hide every identifier-shaped key ('pitch', 'f1', 'spectral_centroid') gets an
alias, so the keys do not list what a withheld function computes. Only keys of a library's dict stay
(os.environ["PATH"], a dict literal handed to a library call); a key that merely matches a
library name ('f2') is still aliased. A library dict is also followed through names
(devs = sd.query_devices(), for d in devs: d['max_input_channels'] stays, in hide too).
In the text of a function that uses a secret table (its name, one of its values, or a table linked
by indexing such as frequencies[target_sequence[i]]), the table's small integers are hidden too
("Symbol 10" -> "Symbol K_0012"); elsewhere small numbers stay. With protected code and
"strings": "scrub", check prints a warning with an example string.
Withheld functions (optional)
Choose functions the AI may call but not read. In the twin their body becomes a stub; everything else is renamed as before:
def fn_0004(self, v_0005):
raise NotImplementedError("doppel: body withheld (B_0001)")
static void fn_0009(uint8_t v_0021[16])
{ /* doppel: body withheld (B_0002) */ }
float fn_0002(const float* v_0014, int v_0015, double v_0016, double v_0017)
{ /* doppel: body withheld (B_0003) */ return (float){0}; }
A non-void C function returns a zero value (return (T){0};, C++ return {};), so the twin builds
with -Werror=return-type; a Python stub raises, so a twin-side test fails where the function is
called, not later with a None.
- Choosing: in
.doppel/config.json:"core_functions": ["detector.py::Detector.classify", "src/filter.c::design_lowpass", "detector.py::Detector"](a class withholds all its methods),"core_modules": ["dsp/", "secret_algo.py"](whole files). - Import puts the real bodies back byte for byte; edits elsewhere merge as usual. If the AI
changes or removes a withheld body, the file is not merged until you take its version with
--accept B_0001. - A change inside a withheld function: the AI is told to describe it in plain words instead of
editing the stub, so you apply it yourself. Or release the body for one session:
doppel withhold release PROJECT B_0001 --reason "widen the pitch range". The next export sends the body, the AI's edit merges as usual, and the export after it withholds the function again. The release and the send are both in the exposure ledger.doppel withhold list PROJECTshows the ids. - Purpose line (optional):
doppel withhold purpose PROJECT B_0002 "returns (gender, confidence) for one chunk"(or right-click it in the outline) lists that line in the twin'sAGENTS.md, so the AI calls the right withheld function. Off unless you write one; it tells the AI the function's role, not its body (names and secret values in it are translated). In pilot round 4 the AI called the feature extractor where the gender decision was meant; both were withheld. - check: the dummy twin still parses / compiles to objects; the machine-code comparison uses the full-body copy, so it stays exact; Python syntax trees are compared without the withheld bodies.
- Exposure: withheld functions are logged as
declaration, notbody, sodoppel reportand the budgets show the real share (e.g. 15 of 17 bodies, 88%). - Python, C and C++ (Java and C# need typed stubs; later). The twin's
AGENTS.md/CLAUDE.mdtell the agent not to implement or change withheld functions.
Exposure ledger
Every export records which function bodies it made available to an AI in
.doppel/ledger.jsonl (append-only, kept as an audit trail). A body is logged when it is new or
changed, or when it is sent again to a new twin folder ("repeat": true); a plain refresh adds
nothing.
python -m doppelcode report <project> # per folder
python -m doppelcode report <project> --by function # first / last sent, how often
python -m doppelcode report <project> --since 2026-11-01
Exposure report - what was made available to an AI (not what it read)
folder functions bodies sent share secrets withheld
src/ 17 17 100% 6
Budgets: "exposure_budget": {"dsp/": 0.3} stops an export that would make more than that share
of a folder's function bodies available; export --allow-over-budget exports anyway and records
the override in the ledger. With today's full twin every exported folder is at 100%, so a budget
acts as a guard ("never export dsp/") until declarations-only export (core modules) exists.
Key config options (.doppel/config.json)
| Key | Default | Meaning |
|---|---|---|
keep, keep_prefixes, keep_regex |
[] |
names never renamed (e.g. vendor HAL_) |
exclude |
[] |
third-party folders: copied verbatim, their names kept |
comments |
hide |
scrub replaces mapped names inside comments, keep leaves them, hide replaces each whole comment by a placeholder in the file's own syntax (/* cmt_0007 */, // cmt_0007, # cmt_0007 in Python, Makefiles and CMake files; same line count) that import restores. Set it with export --comments hide |
strings |
scrub |
scrub replaces mapped names inside strings, keep leaves them, hide replaces each string literal by an id and keeps its format skeleton ("Sample rate: %d Hz\n" -> "str_0002 %d\n"), restored on import (also around the AI's edits). check --objects compares machine code against a names-only twin, so it works with every string setting. Set it with export --strings hide |
data_files |
none |
build: text files that build files name (generated docs, symbol lists) are copied, so the project's own build works; with none they are listed in .doppel/build_inputs.txt and export prints a note. copy: also the data files the code reads, under their aliases. File and folder names in strings always get file-shaped aliases when strings are scrub/hide ("InputFiles//" -> "dir_0001//", "rec_01.dat" -> "file_0001.dat"); with copy, every file in a folder the code names (or named itself) goes to the twin, so the twin program still finds its inputs. Import ignores these folders (no data or program output comes back). Set it with export --data copy |
rename_files |
true (not set: false with a CMake build or build files that compute paths) |
rename file names; false keeps file and folder names (and CMake target names), so the project's own build finds them |
keep_test_names |
true |
in a pytest project, keep test_* / Test* names, pytest_* hooks and pytest's fixture names so the twin's tests run (the names are visible); false hides them |
rename_words |
[] |
extra words to rename everywhere |
build_names |
rename |
rename: in Makefiles / CMake files, words made of the project's name parts (TARGET := falcon_selftest) get w_ aliases, so the build produces a renamed binary, and the build's own options are renamed too (configure the twin with the twin's names). With keep, check reports them as leaks. Set it with export --build-names keep |
sensitive_terms |
[] (init: your OS user name and git user.name) |
words that check reports if still present in the twin (and translate --to-twin warns about): inside other words from 4 letters, as whole words under 4 |
accept_file_names |
false |
true: you accept that the twin keeps your file and folder names (CMake builds, rename_files: false); check then reports them in one hint line instead of failing |
twin_dir |
(none) | the exact twin folder (an absolute path); wins over twin_root. 0.7.0b12: a change moves the twin with the next export. 0.7.0b13: a folder set by hand is confirmed once with doppel trust |
twin_root |
(none) | a neutral folder for the twin (<twin_root>/twin_<hash>); see "Where the twin is". Set it with init --twin-root (which removes twin_dir). 0.7.0b12: a missing folder is created; a change moves the twin with the next export |
hide_output_strings |
false (init writes true) |
0.7.0b12: string literals passed to output-only calls (C printf, fprintf, puts, fputs, perror; Python print and logging methods such as logger.info(...)) are hidden even with strings: scrub or keep, keeping their format skeleton: they only reach the screen, and often hold product and company names. Not sprintf / snprintf or anything whose result is data. Turn it off if your tests compare program output |
output_functions |
[] |
your own output-only calls for hide_output_strings, e.g. ["LOG_INFO"] |
leak_allow |
[] |
words and names check and translate accept (a public project name, a copyright holder); secret values and absolute paths are always reported |
naming |
kind |
kind (fn_/v_/T_/M_) or opaque (id_ for all) |
Files that are not source, build or known text files are not copied to the twin (they may leak); add
them to copy_verbatim if the AI needs them. Build templates, packaging files, scripts (.sh, .pl,
#! files without an extension) and text files a build file names are copied; scripts are never
imported as new files, and changes to existing ones are listed for review.
Security
The twin is written by an AI agent, so DoppelCode treats it as untrusted:
- Import accepts new files only if they are C sources or known text files outside hidden folders.
Scripts (
.bat,.ps1,.sh), binaries, Windows device names and anything under.github,.vscode,.gitand similar are reported asBLOCKEDand never written. Changed build and config files (Makefile,*.mk,*.json, ...) are listed under Review before building. - Links: symlinks and junctions inside the twin are never followed (reported as
IGNORED (link)), andexportrefuses to write or delete through them.exportalso refuses to take over a non-empty folder it did not create (--forceto override). - Compile check: if a twin file includes something outside the twin (absolute,
..or UNC\\host\sharepaths, which would make Windows connect to that host), the compiler is not run. - Leak scan also reports absolute paths, the project folder name and the Windows user name (as
a path segment, an e-mail or a handle only, so a user
rootdoes not flag "rooted"). Absolute paths in build, script and text files (toolchain folders, the source checkout) become$(DOPPEL_PATH_0001)in the twin and come back on import, whatever user name they hold: since 0.7.0b11 also a quoted path with spaces ("C:\Program Files\Vendor Tools\bin", whole) and a path right after a compiler or linker option (-IC:/sdk/include,-LC:\lib,/LIBPATH:C:\lib).checkreports, as "absolute path", any that still reaches the twin, for example in a source file's string. Prose that spells a renamed name out ("read audio file" forread_audio_file) is listed underhints:; it does not fail the check (hideremoves it). - Parts of your names in comments and strings (0.7.0b9):
scrubreplaces whole names, so/* Falcon link self-test */or"FalconLinkKey01"stay.checkreports such parts (4+ letters, used in at least two of your names,falconfromfalcon_encrypt_blockandFalconAesContext) in comments and strings of source files, as it does in build files. A part that is also a common English or technical word (link,round,symbol,frequency,samples) is listed underhints:, not as a leak (0.7.0b10), unless it is one of yoursensitive_terms. The project's folder name counts the same way: a name made of such words (AudioSequence) gives hints, a codename (Atlas_fw,Mercury) is always reported. Name-part leaks are grouped by word, with a readyleak_allowline. Fix:comments/strings: hide, orleak_allow. - Credentials (0.7.0b12):
checkreports API keys by their format (sk-...,sk-ant-...,sk_live_...,AKIA...,ghp_...,github_pat_...,xox?-...), PEM private key blocks, JWTs and connection strings with a password (scheme://user:password@host) as leaks, with file and line; a high-entropy value for a name such as password, secret, token or api_key is a hint.translate --to-twinwarns about them in a request. A value is never printed whole: the first 4 characters, then****.leak_allowacknowledges one by that masked form. - Author lines (0.7.0b9):
Author:,@author,Created by,Written by,Copyright (c) <year> <name>and__author__ = ...lines left in the twin are leaks.checkgroups them by name (500 identical copyright headers are one entry with a count) and prints a"leak_allow": [...]line to copy, or usecomments: hide. Since 0.7.0b12 a copyright after a key counts too (c: Copyright (C) <name>in Markdown front matter,msg = "Copyright 2024 <name>"). - Import checks its snapshots (0.7.0b9):
importcompares the AI's edits with the twin as DoppelCode wrote it (.doppel/twin_base) and merges them against the original as of the last sync (.doppel/base). Each snapshot has its hash in the vault. If one changed since (an agent with access to the project edited it),importrefuses and names the files. Delete a changedtwin_basefile andimportrebuilds it from the base copy; delete a changedbasefile andimportwrites the AI's version of that file next to the original (<file>.doppel-incoming) for you to merge. A vault from before 0.7.0b9 gets the base hashes at its next export. - Large projects:
checkprints a leak summary (counts by kind, the top files, 30 examples, secret values and absolute paths first) and writes the full list to.doppel/leaks.txt(--leaks-allprints it)."leak_allow": ["opus"]accepts words such as a public project name; secret values and absolute paths are always reported. Build and CLI words (cmake, version, option, enable, ...) are not name parts. Headers and modules export could not find are counted and listed in.doppel/missing.txt. - Includes: the compile check refuses a twin whose
#includeis absolute, a drive or UNC path, or goes above the twin root;#include "../x.h"that stays inside the twin is compiled. - Import warns when a new function reuses an existing alias for its own variable (it would come
back as the old meaning); keywords and builtins are not listed as new names. With
comments: hide, placeholder comments (// cmt_0040) the AI left out when it returned whole functions are put back next to the code they belong to; a comment that went together with deleted code stays deleted. - IDE and tool state (
.vs,.settings,*.user, workspace andc_cpp_properties.jsonfiles) is never copied, because it holds absolute paths and user names. .doppel/vault.jsonholds the real names and the hidden comments and strings in plain text, like the project's own sources next to it, so it needs the same care. Keep the project folder private.- The compile check uses the compiler's default C dialect (
compile_flags: []); set the flags of your real build if needed. Files it cannot verify are listed asNOT CHECKEDwith the reason.
Limitations
- A twin builds and compiles like the original, but it does not always behave the same. With
strings: scrub, names inside data strings (command-line option tables, registry keys) may be replaced; withstrings: hide, the program's text output changes. On librosa (pilot, 0.6.4) the original passed 1,957 tests; the twin passed 1,835 (74 failed, 48 errors) withscruband 1,351 (558 failed, 48 errors) withhide. Run your tests on the original afterdoppel import; do not trust failing tests in the twin. - DoppelCode reduces what an AI sees; it does not make code unreadable. Function signatures, call structure, control flow and well-known algorithms stay visible in the twin, and a capable model can often tell what a program does.
- With the default
strings: scrub(and withcomments: scrub), the rest of the text in strings (and comments) stays visible, including words that are parts of your names (for example a product name inside a message or a key string). Usestrings: hidefor code whose messages or keys are sensitive. - With
strings: hide, every format specifier stays visible (%d,%.1f,%1$d,%(rate)d,{0},{x:.2f},${x}); only the words are hidden. In Python, a named specifier's key follows the mapping it is formatted with (0.7.0b12):"%(rate)d Hz" % {"rate": rate},% dict(rate=...)and% locals()keep working in the twin, with the key renamed like the variable when the variable is renamed. A format string kept in a variable and used later (fmt % values) is not followed: if its keys are renamed names, that line can raiseKeyErrorin the twin. Logging formats ("%(name)s") stay as they are. Import restores everything. - Values are hidden only if you mark them (
secret_*);doppel secrets suggestproposes candidates. - A withheld function cannot be edited by the AI: it describes the change in plain words and you apply it, or
you release the body for one session (
doppel withhold release), which is recorded. - A CMake regex that finds several macros by a shared prefix (curl:
"#define LIBCURL_VERSION( |_NUM )") cannot find them once they are renamed: add those macros tokeep. - In CMake projects (or with build files that compute file paths), file and folder names stay visible in the
twin: DoppelCode keeps them unless the config sets
"rename_files": true, so the twin builds with the project's own build.checkreports this as one finding ("File names kept for the CMake build: N files and folders") and fails until you accept it once with"accept_file_names": true; after that it prints one hint line. - In a pytest project, test names (
test_*,Test*),pytest_*hooks and pytest's fixture names are kept so the twin's tests run; they are visible to the AI."keep_test_names": falsehides them. - Comments in script files (0.7.0b11): with
comments: hide, shell, Perl, PowerShell, batch and other#!scripts have their comments hidden too (# cmt_0001,REM cmt_0001,:: cmt_0001,<# cmt_0001 #>). The rules are careful not to break a script the build runs, so some comments stay: trailing comments in Perl (#can be a regex delimiter), comment-like lines inside heredocs and Perl's POD.checkreports what stays. - Comments in documentation, YAML, TOML and configure files (0.7.0b12): with
comments: hide,<!-- ... -->in Markdown,#comments in.yml/.yamland.toml, in pip requirement files (requirements*.txt,constraints*.txt) and#/dnlcomments inconfigure.acare hidden too (copyright headers with authors' names are often there). Code blocks in Markdown, block text in YAML (run: |), multi-line strings in TOML and quoted text inconfigure.ac([#include <stdio.h>]) stay. The rest of their text, and other text files (.txt), stay as they are, with your names replaced; so does YAML front matter at the top of a Markdown file (c: Copyright ...is data, not a comment):checkreports it as an author line. translate(0.7.0b11) maps only the names the last export used: a name that is only in a file you added toignorelater is no longer translated or shown as an example (the vault keeps it for older twins).- Java: plain Java code (libraries, tools) exports, round-trips and compiles. Framework-heavy applications that
bind by name across code, strings and resource files (Spring Data method names, JPA table and column names,
templates,
.properties) do not run in the twin without a config that keeps those names; resource files are not copied by default. This is a known limit. - Leak scans and pilot results reduce risk; they are not a proof that nothing leaks. Review
checkoutput.
Tests
python -m unittest discover -s tests
License
DoppelCode is free for personal use, education, research and other noncommercial purposes under the PolyForm Noncommercial License 1.0.0. Any commercial use, including use by or for a company, requires a paid commercial license: see COMMERCIAL.md.
Metadata
Release files for doppelcode 0.7.0b13
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| doppelcode-0.7.0b13.tar.gz | 316.9 kB | With provenance | Details for doppelcode-0.7.0b13.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| doppelcode-0.7.0b13-py3-none-any.whl | Python 3 | none | any | Details for doppelcode-0.7.0b13-py3-none-any.whl |
Total release size: 525.9 kB
Release files / doppelcode-0.7.0b13.tar.gz
| Download URL | doppelcode-0.7.0b13.tar.gz |
|---|---|
| Size | 316.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
4b93a99cf94b7275135a480c286e001b240eaa152536f35a97a743acd4bc06bc
|
|
BLAKE2b-256 checksum How to use checksums |
038533197aeca61b2e0a498d641d9ccf4071e9bb25a634a4f528d81577c0a3de
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Dec 4, 2026.
Transparency logRelease files / doppelcode-0.7.0b13-py3-none-any.whl
| Download URL | doppelcode-0.7.0b13-py3-none-any.whl |
|---|---|
| Size | 209.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
ffa4e61b5497aa8460f6e1aa5beb46365655161ab0290c240d37769f2c19c6b8
|
|
BLAKE2b-256 checksum How to use checksums |
a04e4e7ab5f4aea235f8ac9eb02d1308b2bcc0e26ada1e8becf6b0044cf2488e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Dec 4, 2026.
Transparency logSecurity for doppelcode 0.7.0b13
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for doppelcode-0.7.0b13.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Dec 4, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.