{"_id":"@agenitry/johndoe","name":"@agenitry/johndoe","dist-tags":{"latest":"0.6.0"},"versions":{"0.6.0":{"name":"@agenitry/johndoe","version":"0.6.0","description":"Frontier AI without raw context exposure.","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"build":"tsc","test":"vitest run","dev":"tsc --watch"},"license":"MIT","devDependencies":{"typescript":"^5.5.0","vitest":"^2.0.0","@types/node":"^20.0.0"},"keywords":["privacy","ai","llm","openai","sanitization","pii","anthropic"],"author":{"name":"Olanotolu"},"repository":{"type":"git","url":"git+https://github.com/olanotolu/Uninitial.git","directory":"ts-sdk"},"publishConfig":{"access":"public"},"gitHead":"53fa9a2222be339a3fea17af12d6c1b60384839f","_id":"@agenitry/johndoe@0.6.0","bugs":{"url":"https://github.com/olanotolu/Uninitial/issues"},"homepage":"https://github.com/olanotolu/Uninitial#readme","_nodeVersion":"24.15.0","_npmVersion":"11.12.1","dist":{"integrity":"sha512-3BtYfzC6SNVBTcUqYLok94pFmlp2GLbQnMs7ermpM5771UtTBKEq5GbEvAAdew/mqHddcJHQGPk/Xvf27Kpwmw==","shasum":"314f3072335d63e134f1510943ee2b177fe120d2","tarball":"https://registry.npmjs.org/@agenitry/johndoe/-/johndoe-0.6.0.tgz","fileCount":46,"unpackedSize":57281,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQC4ZBkt/WYKOJzPv8FK4ux+cccpHauBKGi9a6qdviLQlwIgcReMAlwwKVwnIW1V4RoNntvXZWZnvbKaG0LfQ5rFsRM="}]},"_npmUser":{"name":"agenitry","email":"ola@agenitry.com"},"directories":{},"maintainers":[{"name":"agenitry","email":"ola@agenitry.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/johndoe_0.6.0_1783650051493_0.384578488712195"},"_hasShrinkwrap":false}},"time":{"created":"2026-07-10T02:20:51.246Z","0.6.0":"2026-07-10T02:20:51.654Z","modified":"2026-07-10T02:20:51.924Z"},"maintainers":[{"name":"agenitry","email":"ola@agenitry.com"}],"description":"Frontier AI without raw context exposure.","homepage":"https://github.com/olanotolu/Uninitial#readme","keywords":["privacy","ai","llm","openai","sanitization","pii","anthropic"],"repository":{"type":"git","url":"git+https://github.com/olanotolu/Uninitial.git","directory":"ts-sdk"},"author":{"name":"Olanotolu"},"bugs":{"url":"https://github.com/olanotolu/Uninitial/issues"},"license":"MIT","readme":"# @uninitial/johndoe\n\n> Frontier AI without raw context exposure.\n\n## Quick Start\n\n```bash\nnpm install @uninitial/johndoe\n```\n\n```typescript\nimport { JohnDoe } from \"@uninitial/johndoe\";\n\nconst ai = new JohnDoe({\n  provider: \"openai\",\n  apiKey: \"sk-...\",\n  customEntities: [\"Acme Corp\", \"Stripe\"],\n});\n\nconst { response, receipt } = await ai.askWithReceipt(\n  \"We are acquiring Stripe next quarter. Draft the board memo.\"\n);\n\nconsole.log(response);\nconsole.log(receipt.route, receipt.leakageScore);\n```\n\n## Architecture\n\nImplements the **Judge-Ghost-Witness** protocol:\n\n1. **Judge** — detects sensitive entities (emails, SSNs, phones, API keys, custom entities), assigns sensitivity score\n2. **Ghost** — replaces entities with placeholders, adds structural privacy preamble, restores real values in response\n3. **Router** — routes based on sensitivity (public / enclave / local)\n4. **Witness** — verifies no leaks, detects inference attempts, computes leakage score\n5. **TraceCollector** — records privacy-safe traces (hashes only, no raw data)\n\n## API Reference\n\n### `new JohnDoe(options)`\n\n| Option | Default | Description |\n|--------|---------|-------------|\n| `provider` | `\"openai\"` | Provider (`openai`, `anthropic`) |\n| `apiKey` | env var | Provider API key |\n| `model` | provider default | Model name |\n| `customEntities` | `[]` | Additional entity names to detect |\n| `ghostMode` | `\"structural\"` | Transform mode (`structural`, `plain`) |\n| `trace` | `false` | Enable trace collection |\n| `tracePath` | `~/.uninitial/traces.jsonl` | Custom trace file path |\n\n### Methods\n\n- `ai.ask(prompt) → Promise<string>` — full pipeline\n- `ai.askWithReceipt(prompt) → Promise<{response, receipt}>` — full pipeline with PrivacyReceipt\n- `ai.judge(prompt) → IntentGraph` — Judge only\n- `ai.ghost(intentGraph) → string` — Ghost only\n- `ai.witness(response, intentGraph) → AuditReceipt` — Witness only\n\n## Using with the Proxy\n\n```typescript\nimport OpenAI from \"openai\";\n\n// Point your existing OpenAI client at the Uninitial proxy\nconst client = new OpenAI({\n  baseURL: \"http://localhost:8000/v1\",\n});\n\n// All requests now pass through Judge-Ghost-Witness\nconst response = await client.chat.completions.create({\n  model: \"gpt-4o\",\n  messages: [{ role: \"user\", content: \"...\" }],\n});\n// response includes x-uninitial-privacy-receipt\n```\n\n## License\n\nMIT\n","readmeFilename":"README.md","_rev":"1-c269d76da820f6ddb12b3be53cc1ddd0"}