obsify
obsify
AIアシスタントが機密ファイルを扱う際、生の値がモデルのコンテキストに入ることを防ぎます。
obsifyはローカルで動作する決定論的なMCPサーバーです。フロンティアモデルは形状(スキーマ、合成ツイン、マスクされたフィードバック)について推論し、決定論的なローカルコードが実体に触れ、マスクされた集計結果のみを返します。LLM呼び出しはなく、実行時にネットワークも不要です。検出は正規表現+チェックサム+辞書+PresidioのローカルNERを使用します。
オーストラリアのエンティティサポート(ABN / ACN / TFN、チェックサム検証済み)と、ラベル駆動のルーティングレイヤーを備えており、「アシスタントがいつ生データを避けるべきか」を判断ではなく、決定論的で強制された決定にします。
正直な範囲:
run_on_realはモデルが書いたコードをベストエフォートのローカルサンドボックスで実行し、その出力をベストエフォートでマスクします。これは刑務所ではありません。漏洩させられないものを指定する前にSECURITY.mdをお読みください。集計結果を返してください。
なぜ
機密文書をホスト型LLMに送信すると、実体が境界外に出てしまいます。通常の答えは「LLMを使わない」か「プロバイダーを信頼する」です。obsifyは第三の道を取ります——計算からデータへ:データをモデルに持ってくるのではなく、コードをデータに持って行きます。
モデルはスプレッドシートのスキーマを見ますが、行は見ません。
モデルは合成ツイン(偽の値、実際の構造)に対して開発します。
モデルの分析コードはローカルで実行され、マスクされた集計出力のみが返ります。
フロンティアモデルの推論は保持されます。生の値に対する目だけが取り除かれます。
Related MCP server: taskvault
ツール
ツール | 機能 | 戻り値 |
| ファイル/フォルダのPIIをスキャン | 種類、場所、カウント — 値は決して返さない |
| Excelワークブックの忠実な偽造 | スキーマの概要; |
| 計算からデータへ:実際のファイルに対してローカルでコードを実行( | PIIマスク済み、サイズ制限付きのstdout/stderrのみ — 集計結果を返す |
| 文字列内のPIIを | 編集済みの文字列 |
|
|
|
対応ドキュメント: PDF(テキスト+表;複雑な表はobsify[tables]でフォールバック)、Excel .xlsx/.xlsm、Word .docx(段落+表)。読み取り不能または未対応のファイルは、明示的な注記/盲点として表示され、静かに破棄されることはありません。(OCRは未対応 — スキャン/画像ページは低カバレッジとしてフラグされ、文字起こしはされません。)
既知エンティティのマスキング(オプション)。 ローカルの.obsify.entitiesリストに隠したい名前を指定すると、scan_pii / redact_textがそれらを決定論的に捕捉します — NERが見逃す接尾辞/略語のバリアント(BRIGHTWATER HLDGS P/L for Brightwater Holdings Pty Ltd)も — KNOWN_ENTITYとして。リストはローカルに留まり、モデルのコンテキストに入ることはありません。詳細はdocs/known_entities.mdを参照。
デモ
公式のMCP Inspectorを使って、5つのツールすべてを合成データに対してライブで試せます:
python -m obsify.make_corpus --out ./corpus_demo
npx @modelcontextprotocol/inspector obsify-mcp./corpus_demo/ledger.xlsxに対してscan_piiを呼び出し、種類/カウント/場所のみを返し、値は決して返さないことを確認してください。docs/verifying.mdを参照。
試してみる — 合成コーパス
偽造だが現実的なコーパス(すべて合成;ABN/ACN/TFNはチェックサム検証済み)を生成し、3つの形式すべてにわたって、ツールを指定します:
pip install "obsify[demo]" # reportlab, for the sample PDFs
python -m obsify.make_corpus --out ./corpus_demoこれにより、マルチシートのExcel台帳(数値の偽陽性の地雷原)、PDFのエンゲージメントレター(散文+試算表)、DOCXの監査メモ(段落+ベンダー表)が書き込まれます。実際のデータに触れずにscan_pii / make_synthetic_twinを試すのに最適です。
MCPサーバーとしてインストールして実行
Python 3.11+が必要です。obsifyはstdio上でMCPを話します — クライアントがローカルサブプロセスとして起動し、リモートでホストされるものはありません。MCP対応クライアント(Claude Desktop、Claude Code、Cursor、VS Code、…)に、そのクライアントの設定に1ブロック追加して登録します。
推奨 — uvxによるゼロインストール:
{ "mcpServers": { "obsify": { "command": "uvx", "args": ["obsify-mcp"] } } }uvxはPyPIからobsifyを取得し、オンデマンドで実行します — 恒久的なインストールは不要です。初回実行時、obsifyはspaCy NERモデル(en_core_web_lg、約560 MB)を一度ダウンロードしてキャッシュします。これは公開モデルを取得し、ユーザーデータは送信しません(OBSIFY_AUTO_DOWNLOAD=0を設定して禁止し、自分でモデルをインストールすることもできます)。以降の実行は瞬時で完全にオフラインです。
またはインストール(pip / pipx):
pipx install obsify # isolated, on PATH (or: pip install obsify)次に、クライアントをインストールされたコマンドに向けます:
{ "mcpServers": { "obsify": { "command": "obsify-mcp" } } }クライアントを再起動するとツールが表示されます。オプションの追加機能:obsify[tables](camelot + Ghostscriptによる複雑な表のPDFフォールバック)、obsify[compute](pandas、run_on_realコード内で便利)。
PATHの落とし穴(「サーバーが接続できない」原因の第1位):
commandはクライアントが見るPATHで解決可能でなければなりません。GUIクライアントはvenvのPATHを共有しない場合があります。修正方法:uvx/pipxを使用する(グローバルに解決可能)、または絶対パスを指定する —"/path/to/.venv/bin/obsify-mcp"(macOS/Linux)または"C:\\path\\.venv\\Scripts\\obsify-mcp.exe"(Windows)。
このリポジトリから(PyPIに公開される前):
pip install "git+https://github.com/Formative-Sum41/obsify.git" # gets `obsify-mcp` + `obsify`ルーティングレイヤー — 判断ではなく決定論的
「助けてくれ、でも機密ファイルは読まないで」という難しい部分は、いつ保護するかを決めることです。obsifyはその決定をモデルから環境に移します:
.obsify.json— パスを分類するラベルマニフェスト(public/confidential/restricted)。obsify.guard(python -m obsify.guardとして実行) — ラベル付きファイルの直接読み取りをブロックし(終了コード2)、アシスタントをscan_pii/make_synthetic_twin/run_on_realにリダイレクトするPreToolUseガード。規約(
CLAUDE.md内) — アシスタントがガードに引っかかる前にobsifyを優先するようにします。
1つのコマンドでセットアップ:
obsify init [--dir PATH] [--with-claude-md]obsify initは設計上非破壊的です — 正確に1つのファイルを所有し、残りのスニペットを提供します:
.obsify.json— obsifyが所有;initが書き込みます(--forceなしでは上書きされません)。.claude/settings.json— あなたのファイル:initはPreToolUseフックブロックを表示して貼り付け用に出力し、編集はしません(コードを実行するため、登録はあなたの判断です)。CLAUDE.md— あなたのファイル:規約はオプトインです。デフォルトでは表示します;--with-claude-mdはマーカーで囲まれた冪等なブロックを追加し、あなたのコンテンツを決して上書きしません。
完全な規約:docs/obsify_routing.md。
検出の精度を保つ方法
チェックサム検証済み識別子。 ABN/ACN/TFNの候補は正規表現で提案され、公式のチェックサムで確認されるため、ランダムな数字が識別子として報告されることはありません。
コンテキストが必要なID。 裸の数字は、ラベルワード(「TFN」、「ABN」、「BSB」、…)が近くにある場合にのみABN/ACN/TFNとして受け入れられます — これにより、数値台帳での連続仕訳IDの偽陽性の洪水を防ぎます。
文字なし / NER+数字の抑制。 純粋な数字、金額、日付、英数字コードは名前/組織としてフラグされません。実際の名前、メール、住所(文字を含む)は影響を受けません。検証済みの文字なしPIIは例外のまま:チェックサムID(ABN/ACN/TFN/Medicare)、Luhnカード、有効なIP、BSBに隣接する口座、電話番号(コンテキストまたは電話の形状による) — 小数点は依然として金額を示し、電話番号ではありません。
測定された精度
obsifyにはスコア付き評価ハーネス(eval/ — ラベル付き合成コーパス+解答キー+出荷時の検出器に対するスコアラー、さらに独立した第三者によるクロスチェック)が含まれています。合成コーパスの見出し:期待検出項目に対して100%再現率、数値FP拷問シート(グループ化数字ガード付き)で0偽陽性、裸のコンテキストゲートIDは正しく抑制。Microsoft presidio-researchとの独立クロスチェック:EMAIL/IBAN 100%、PERSON 94%。
ハーネスはその価値を証明しました — 実際の欠陥を発見し、その後修正されました: クレジットカードと電話番号が数値ノイズフィルターによって静かに抑制されていました(現在はチェックサム検証/電話形状によって例外)、Medicare、IP、生年月日、オーストラリアのパスポートと運転免許証には認識機能がありませんでした(現在は追加され、チェックサムまたはコンテキストでゲート)。完全な方法、数値、残っている文書化されたギャップ(SWIFT/BIC、非DOB日付):eval/README.md。
テスト
pip install -e ".[dev]"
pytest tests/ # or run any file directly: python tests/test_obsify.py12スイート(73テスト)、CIでLinux + Windows / Python 3.11 + 3.12で実行:
mcp-protocol — 実際のサーバーをstdioで起動し、MCPを話します(Claudeのようなクライアントが使用するのと同じパス):5つのツールすべてが有効なスキーマで登録され、呼び出しがJSON-RPCを介してラウンドトリップすることを確認 —
scan_piiが形状のみをエンドツーエンドで返すことを含む。checksums — 外部公開されたABN/ACN/TFNの実例(有効および破損)に固定され、ジェネレーター↔バリデーターの循環性を断ち切ります。
obsify / twin / redaction — プライバシーの不変条件:形状のみの出力、漏洩のないツイン、フェイルクローズの自己チェック。
precision — 偽陽性抑制機能が数値台帳ノイズを除去しつつ、実際の名前を保持することを確認。
routing — ガードのブロック/許可分類と
obsify initの非破壊的契約。corpus — 合成PDF+Excel+DOCXコーパスのエンドツーエンド:形式ごとの検出、DOCXの段落+表抽出、すべての形式での形状のみの出力。
evaluation — スコア付きハーネスを回帰ゲートとして(再現率、抑制、FP拷問、ギャップ)。
robustness — グレースフルデグラデーション:破損/巨大/空/ネスト/未対応の入力が決してクラッシュせず、常に注記として表示される。
model / variants — 初回実行時のモデル自動ダウンロードロジック;
verify_value_freeの背後にあるバリアント正規化。
インタラクティブな検証(MCP Inspector)とライブクライアントの最終確認については、docs/verifying.mdを参照。
ライセンス
MIT — LICENSEを参照。
Available Tools
5 toolsmake_synthetic_twinA
Generate a SYNTHETIC TWIN of a real Excel workbook at path, written to
out. Schema (sheets, headers, column types, true row counts) is preserved;
every data value is freshly FAKED — no real value is copied. Reason and write
your analysis code against the twin; then run it on the real file with
run_on_real. Returns the schema summary (safe shape).
Inputs: out (required), path (required), cap_rows.
redact_textA
Return text with detected PII replaced by placeholders (e.g.
<AU_TFN>, ). Deterministic; checksum-validated identifiers and
context/precision rules apply so bare numbers are not over-masked.
entities is an optional PATH to a local .obsify.entities file of KNOWN names
to hide; matches (incl. variants) are masked as <KNOWN_ENTITY>. If omitted, a
nearby .obsify.entities is auto-used.
Inputs: text (required), entities. Returns: result
run_on_realA
COMPUTE-TO-DATA: execute your Python code LOCALLY against the real file at
data_path (bound to the variable DATA_PATH in your code); the returned output
is size-capped and best-effort PII-masked. The data never enters your context;
substance never leaves. Return AGGREGATES (counts/sums/summaries) via print() —
output masking is defense-in-depth, NOT a guarantee (NER can miss a name in a raw
record), so never print raw records or identifiers. The masking field carries this
caveat with the result. Network is disabled and a timeout applies.
Inputs: code (required), data_path (required), timeout.
scan_piiA
Scan a file or folder for PII and return TYPES + LOCATIONS + COUNTS only — never the detected values. Safe to surface to an LLM: it learns what PII exists and where, without the substance entering context. Recurses into subfolders; skips unreadable files and caps very large sheets, reporting both as notes.
entities is an optional PATH to a local .obsify.entities file (one name per
line) of KNOWN names to hide; matches (incl. suffix/abbreviation variants) are
reported as KNOWN_ENTITY. If omitted, a nearby .obsify.entities is auto-used.
The names are read locally and never returned.
Inputs: path (required), entities, max_cells.
verify_value_freeA
Fail-closed check that text contains NONE of terms (nor their
suffix-normalized / distinctive-token variants). Returns {"value_free": bool}
with zero detail on what matched — for verifying an artifact before it leaves
the perimeter.
Inputs: text (required), terms (required).
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 5 tools
Each tool has a clear, distinct purpose: make_synthetic_twin creates a fake dataset, run_on_real executes code against real data, scan_pii identifies PII locations, redact_text masks PII in text, and verify_value_free checks for forbidden terms. No two tools overlap in what they accomplish.
Most tools follow a verb_noun pattern (make_synthetic_twin, scan_pii, redact_text, verify_value_free), but run_on_real breaks the pattern with a prepositional phrase. The style is consistent (all snake_case, verbs first) but the deviation is noticeable.
With 5 tools, the count is well-scoped for a focused PII-handling server. Each tool covers a necessary step in the workflow, and the count is within the typical 3-15 range, though a few additional helpers could be justified (e.g., a check for twin accuracy).
The tool surface covers the core lifecycle: protect data (scan, redact, verify) and enable safe analysis (twin, run on real). Minor gaps exist, such as no tool to validate the synthetic twin's fidelity against the real file, and verify_value_free lacks a positive counterpart, but agents can work around these.
Maintenance
Related MCP Connectors
Governed access to sensitive data, secrets and APIs for AI agents. A signed proof for each decision.
Deterministic runtime safety for AI agents: scan PII, gate tool actions, verify LLM output.
300+ deterministic data utilities for AI agents: validate, normalize, parse, match, redact.
Security gateway for AI agents: policy, approval, and audited execution, no secrets shared.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceLet LLMs analyze sensitive data safely by querying a tokenized, join-preserving copy of the database, with fail-closed PII scanning and provable numeric equivalence.MIT
- AlicenseNot gradedqualityBmaintenanceEnables AI agents to access only task-relevant data with secrets hidden and personal details pseudonymized, while enforcing destination policies to prevent data leakage even under prompt injection.2AGPL 3.0
- FlicenseNot gradedqualityNot gradedmaintenanceEnables agents to encrypt and sanitize sensitive data such as credentials, credit card numbers, and addresses locally before dispatching prompts to cloud LLMs, then rehydrate the masked values client-side. It runs deterministically with zero external dependencies over MCP JSON-RPC stdio, so no plaintext PII leaves the user's machine.-
- AlicenseNot gradedqualityBmaintenanceEnables AI coding assistants to audit datasets against DAMA-DMBOK quality dimensions, sanitize PII, generate differential-privacy synthetic twins, compress prompt context, and export dbt schema tests and interactive HTML reports. It supports development against sensitive data with zero real records exposed to external LLMs.1MIT