Skip to main content
Glama
GigantesHJI

securedact-mcp

SecuRedact MCP

PyPI Python License: Apache-2.0

SecuRedact は、AIエージェントおよびAIワークフローのためのローカルファーストのプライバシー・セキュリティレイヤーです。個人データ / PII、GDPR関連の機密情報、認証情報、APIキー、トークン、シークレット、機密ファイルなど、モデル、ツール、ファイル、外部送信先にデータが到達する前に、機密データを検出して保護します。

SecuRedact MCP は、Apache-2.0 のオープンソースMCPサーバーであり、再利用可能なPythonプライバシーエンジンです。機密テキストを検出し、バージョン管理されたポリシーを適用し、ローカルで編集(redact)し、残存出力を検証してから、サニタイズ済みコンテンツを承認済みとしてマークします。

MCPモードはすべてのプロンプトを自動的にインターセプトするわけではありません。ホストはツールを呼び出し、status == "ok" の場合にのみ sanitized_text を送信する必要があります。設定が誤っている、または悪意のあるMCPホストは、通常のMCPワークフローをバイパスできます。プロバイダー固有の強制フックは別の統合アセットです。サポートされているプロバイダーがプロンプトライフサイクル境界でそのようなフックを呼び出す場合、通常のモデル処理の前に同じ決定論的判定を適用できます。SecuRedact Enforced を参照してください。

SecuRedact の利点

AIエージェントはますますファイルを読み取り、ツールを呼び出し、外部モデルにプロンプトを送信しています。そのため、データを事前にチェックする仕組みがなければ、PII、認証情報、機密文書が露出するリスクがあります。SecuRedact はAIワークフローのためのプライバシー・セキュリティ制御です。

  • ローカルファースト — すべての検出、編集、ポリシー評価はお使いのマシン上で実行されます。デフォルトではネットワークリスナーなし、テレメトリなし、プロバイダー呼び出しなし。

  • PII / GDPR 検出 — 氏名、メールアドレス、IBAN、識別子、特別カテゴリのデータを検出し、仮名化または編集します。

  • シークレット・認証情報の保護 — APIキー、トークン、パスワードを検出し、環境外への送信をブロックします。

  • ファイルシステム保護 — 読み取りはトラバーサル/シンボリックリンクエスケープから防御され、.env などの保護されたパスへのアクセスをブロックします。

  • AIエージェントプライバシーファイアウォール — Claude Code および Gemini CLI 用の強制フックが、プロンプト、モデル呼び出し、ツールアクションの前に同じローカル判定を実行します。

  • ネットワーク / エグレス認識 — 外部ツール呼び出しを分類(内部/外部/不明)し、ポリシーで承認を要求したり、エグレスをブロックしたりできます。

SecuRedact は機密データの露出を減らすのに役立ちますが、コンプライアンスを保証するものではなく、すべての漏洩を防ぐことを主張するものではありません。制限事項 を参照してください。

Related MCP server: phi-redact-mcp

クイックスタート

PyPI からインストールし、ガイド付きセットアップを実行します(Windows):

py -3.12 -m pip install "securedact-mcp[ml]"
securedact-mcp setup

Linux / macOS:

python3.12 -m pip install "securedact-mcp[ml]"
securedact-mcp setup

数秒でテキストを保護します(決定論のみのデモ、モデル不要):

import os

os.environ["SECUREDACT_REQUIRE_FLAIR"] = "0"  # deterministic detectors only
from securedact_core import RedactionRequest, SecuredactEngine

engine = SecuredactEngine.from_environment()
result = engine.prepare(
    RedactionRequest(
        text="Contact alex@example.test, IBAN NL91ABNA0417164300",
        policy="strict_external_ai",
    )
)
print(result.status)  # "ok"
print(result.sanitized_text)  # "Contact [EMAIL_1], IBAN [IBAN_1]"

再現可能な合成セキュリティデモ:docs/distribution/security-demo.md

安全なデフォルトワークフロー

通常の外部AI準備には prepare_for_external_ai を使用します:

{
  "text": "Contact alex@example.test",
  "policy": "strict_external_ai",
  "language": "auto",
  "response_mode": "minimal"
}

承認済みレスポンス:

{
  "schema_version": "1",
  "status": "ok",
  "sanitized_text": "Contact [EMAIL_1]",
  "counts": {"email": 1},
  "policy": "strict_external_ai",
  "policy_version": 1,
  "policy_digest": "...",
  "reason_codes": []
}

review_required および blocked レスポンスには、承認済みの sanitized_text は含まれません。最小限のレスポンスには、restore_capable が明示的に選択されていない限り、元のテキスト、生のエンティティ値、マッピング、例外本文、スタックトレース、モデルパス、復元ハンドルは含まれません。

アーキテクチャと信頼境界

flowchart LR
    H["MCP host"] --> M["Securedact MCP"]
    M --> D["deterministic detectors"]
    M --> C["contextual detectors"]
    D --> P["policy engine"]
    C --> P
    P --> R["redactor"]
    R --> V["residual validator"]
    V --> O["approved sanitized output"]
    O --> W["host-controlled downstream workflow"]
    H -. "host may bypass MCP" .-> W

サーバーには、プロバイダークライアント、OpenAI互換プロキシ、リバースプロキシ、ウェブサイト、デスクトップチャットボット、プロバイダー認証情報、プロバイダー固有の転送機能はありません。ADR 0001脅威モデルを参照してください。

ツール

ツール

想定される用途

機密レスポンスの動作

prepare_for_external_ai

推奨される完全な安全ワークフロー

デフォルトで最小限

analyze_text

低レベルのローカル分析/レビュー

最小限。review 内のオフセット。生の値はデバッグモードが有効な場合のみ

redact_text

低レベルの互換性操作

デフォルトで最小限。明示的な legacy モードは機密であり、非推奨

restore_text

ローカルの不透明セッションを消費する

デフォルトで単回使用。直接マッピングには明示的な信頼済みレガシーモードが必要

create_safe_copy

承認済みの .txt/.md コンテンツを設定済みルートの下に書き込む

マッピングや絶対パスを返さない

securedact_read_file

ローカルファイルを安全に読み取り、サニタイズ済みテキストのみを返す

読み取り前に保護パスをブロック。トラバーサル/シンボリックリンク/バイナリを拒否。デフォルトで minimal

レスポンスモードは minimalreviewdebugrestore_capable です。デバッグは、プロセスが SECUREDACT_ENABLE_DEBUG_RESPONSES=1 で起動された場合を除き無効です。MCPリクエストで有効にすることはできません。インメモリ復元セッションは、暗号学的ランダムハンドル、容量制限、有効期限、並行性保護、単回使用消費を使用します。プロセス終了時にすべてのセッションが破棄されます。

MCPツールレスポンスプライバシー復元セッションを参照してください。

インストール

Python >=3.12,<3.13 がサポートされています。

PyPI からの通常インストール:

py -3.12 -m pip install "securedact-mcp[ml]"
securedact-mcp setup

Linux または macOS では、python3.12 -m pip install "securedact-mcp[ml]" を使用します。python がサポートされている 3.12 環境をすでに選択している場合は、python -m pip install "securedact-mcp[ml]" も適切です。

setup は、パッケージ、Python、ML依存関係をチェックし、ローカルモデルの状態を検査し、既存の同意ベースのモデルインストーラーを提供し、既存のオフラインベリファイアを実行し、それらのホストが検出された場合にパッケージ化された Claude Code および Gemini CLI 統合を提供します。プロバイダーの公式プラグイン/拡張コマンドを使用し、再実行しても安全です。プロバイダーモデルAPIを呼び出したり、プロバイダーの信頼を自動的に受け入れたり、ユーザーが明示的にモデルセットアップを選択して既存のアップストリームプロンプトを受け入れない限り、コンテキストモデルをダウンロードしたりしません。

手動モデルコマンドは、高度な操作や無人操作のために引き続き利用できます:

securedact-mcp install
securedact-mcp models verify
securedact-mcp

最後のコマンドはローカル stdio サーバーを起動します。標準出力はMCPプロトコルメッセージ用に予約されています。securedact-mcp setup --non-interactive は、アップストリームの受け入れを意味することなく状態を報告し、新しいプロバイダーを設定しません。対象を絞った対話型プロバイダーセットアップには --host claude--host gemini、または --host all を使用します。

開発者/ソースインストール

レビュー済みのソースチェックアウトから作業する場合:

git clone https://github.com/GigantesHJI/securedact-mcp.git
cd securedact-mcp
python -m pip install ".[ml]"
securedact-mcp setup

モデルチェックポイントはリポジトリやホイールに含まれておらず、起動時にダウンロードされることもありません。Securedact はこれらのモデル重みを再配布しません。アップストリームのモデル重みは独自のライセンスを保持し、Apache-2.0 によって再ライセンスされることはありません。モデルインストールサードパーティライセンスを参照してください。

決定論のみのローカル開発は明示的に選択する必要があります:

$env:SECUREDACT_REQUIRE_FLAIR = "0"
securedact-mcp

本番環境ではデフォルトでコンテキスト機能が必要であり、設定されたモデルが欠落、ロード中、破損、または利用不能な場合はフェイルクローズします。

ホストパッケージ

テスト済みの設定アセットと安全なワークフロー手順は、Codex、Cursor、Windsurf 用に integrations/ の下にあります。自動化されたMCPクライアントハーネスは、サーバー起動、ツール一覧、呼び出し、最小レスポンス形状、stdout整合性、シャットダウンを検証します。実際のホストがすべてのプロンプトに対してツールを呼び出すことを証明するものではありません。互換性エビデンスを参照してください。

リポジトリは Gemini CLI 拡張ルートでもあります:gemini extensions install https://github.com/GigantesHJI/securedact-mcp でフックをインストールできます。gemini-cli-extension トピックと、タグツリーにルートマニフェストを含むリリースが、そのパスが解決するために必要です。pip install "securedact-mcp[ml]" とローカルモデルがなければ、インストールされたフックは何も強制しません。SecuRedact Enforced を参照してください。

ポリシーとPython API

組み込みには defaultstrict_external_aigdpridentifiers_onlyreview_all_contextual が含まれます。互換性ポリシーも引き続き利用できます。ローカル組織ポリシーファイルは、管理されたポリシーディレクトリからのみロードされ、厳密な宣言型スキーマを使用し、フェイルクローズの不変条件を無効にできません。不明、重複、過大、不正な形式、またはシンボリックリンクされたポリシーはフェイルクローズします。

from securedact_core import RedactionRequest, SecuredactEngine

engine = SecuredactEngine.from_environment()
result = engine.prepare(
    RedactionRequest(
        text="Contact alex@example.test",
        policy="strict_external_ai",
    )
)

from_environment() はコンテキストモデルの要件を保持します。スタンドアロンの決定論的開発には SECUREDACT_REQUIRE_FLAIR=0 が必要です。アプリケーションはテスト済みの検出器実装を注入することもできます。公開APIポリシーを参照してください。

再現可能な開発

コミットされた uv.lock は、Python 3.12 のランタイム、ML、開発、ベンチマーク、セキュリティのエクストラを解決します。

uv sync --frozen --extra dev --extra benchmark
uv run python scripts\verify.py

テスト、問題、スクリーンショット、フィクスチャ、プルリクエストで実際の個人情報、プライベート文書、認証情報、顧客ログ、モデル重みを使用しないでください。CONTRIBUTING.md を参照してください。

評価とパフォーマンス

uv run python -m securedact_eval quality --mode deterministic --gate `
  --thresholds benchmarks\thresholds.json `
  --baseline benchmarks\baselines\quality-deterministic.json
uv run python -m securedact_eval performance --mode deterministic

バージョン管理された合成コーパスは、正確および緩和されたスパンの適合率、再現率、F1、偽陽性率、偽陰性率、エンティティ/言語/ドメイン/分割ごとの結果、アクション/カテゴリの精度、ブートストラップ再現率区間を報告します。真陰性はドキュメントレベルのネガティブ例であり、トークンレベルの安全性ではありません。GDPR関連スイートは検出評価であり、法的コンプライアンス認証ではありません。実際の Flair および GPU ベンチマークには、明示的に設定されたローカルモデルが必要であり、通常のCIではありません。ベンチマークを参照してください。 ベンチマークフレームワークは、ローカルデータ層と大規模プロファイルを文書化しています。移行計画は、将来の抽出境界を定義します。GitHubがリポジトリステップを実行する前に失敗した場合は、CIトラブルシューティングの決定木を使用してください。ローカルの成功は、必要なGitHubチェックの代わりにはなりません。

セキュリティと制限事項

  • プロンプト、検出結果、マッピング、復元ハンドル、シークレット、モデル入力、復元された出力は、アプリケーションコードによってログに記録されません。

  • 決定論的およびコンテキスト検出は、新規、曖昧、または敵対的な開示を見逃す可能性があります。共参照や普遍的な難読化耐性は主張されません。

  • レビューオフセットにより、元の入力を持つ信頼できるローカルクライアントが値を再構築できます。レビューレスポンスはローカルに保持してください。

  • ホストの動作とダウンストリームプロバイダーの動作は信頼境界の外にあります。

  • ファイルに文書化されたリポジトリのセキュリティ設定は、管理者による検証が依然として必要です。

脆弱性は SECURITY.md を使用して非公開で報告してください。脆弱性の詳細や実際のデータを公開の issue に記載しないでください。

ライセンス

元のリポジトリのソースとドキュメントは Apache License 2.0 の下でライセンスされています。著作権表示は NOTICE に記録されています。サードパーティの依存関係とモデル重みは独自のライセンスを保持します。

Available Tools

6 tools
analyze_textA

Inspect text locally and report detected sensitive content without producing sanitized output.

Use this when you need to understand what PII, secrets, or credentials are present (counts, entity types, and, with review/debug modes, positions) but do not need redacted text for transmission. The original text is not modified and no sanitized representation is returned. For a policy-approved, ready-to-send result use prepare_for_external_ai; for a sanitized file use create_safe_copy; for reversing a prior local session use restore_text.

Returns a JSON object with 'status' ('ok', 'review_required', or 'blocked'), 'policy', 'policy_version', 'policy_digest', 'counts' (entity-type tallies), and, when response_mode is 'review' or 'debug', a 'findings' list. 'debug' additionally returns 'debug_details'.

ParametersJSON Schema
NameRequiredDescriptionDefault
textYesFree text to inspect locally for sensitive content. Processing is on this machine only; the original text is never modified or transmitted.
policyNoNamed analysis policy controlling which detectors and entity types apply. Defaults to 'default'. Common values include 'default'; other policies may be registered in your environment. An unknown name returns a policy_not_found error.default
response_modeNoLevel of detail returned. 'minimal' returns only status and entity-type counts; 'review' additionally returns a 'findings' list with spans and entity types; 'debug' additionally returns 'debug_details' (only when debug responses are enabled). Defaults to 'minimal'.minimal

Output Schema

ParametersJSON Schema
NameRequiredDescription

No output parameters

TDQS

A4.9/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure. It states the text is processed locally, never modified, and no sanitized representation is returned. It also discloses conditions like 'debug responses are enabled' and the policy_not_found error, giving a complete picture of side effects and edge behavior.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is dense but well-organized: a one-line purpose statement, then usage guidance, alternatives, and return format all in a compact sequence. Every sentence adds value; there is no fluff or repetition, and the critical scoping constraint ('without producing sanitized output') is front-loaded.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

The tool has 3 parameters, all fully documented in the schema, and an output schema (implied via the described JSON structure). The description explains the return object thoroughly, including conditional fields for review/debug modes, and covers error behavior for unknown policies. Nothing an agent needs to invoke it correctly is missing.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

All three parameters already have descriptive schema entries (coverage 100%), so the baseline is 3. The description adds meaningful context beyond the schema: it explains the effect of response_mode on the return structure, describes the policy error condition, and reiterates local-only processing for the text parameter. This extra context justifies a 4 rather than a baseline 3.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description opens with a specific verb-resource pair ('Inspect text locally') and explicitly distinguishes the tool by stating it reports sensitive content 'without producing sanitized output.' This clearly differentiates it from siblings like prepare_for_external_ai and create_safe_copy, making its purpose immediately unambiguous.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description gives explicit when-to-use guidance: 'Use this when you need to understand what PII, secrets, or credentials are present... but do not need redacted text for transmission.' It then names three alternatives with their appropriate contexts (prepare_for_external_ai, create_safe_copy, restore_text), leaving no ambiguity about tool selection.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

create_safe_copyA

Sanitize text locally and write the approved result to a new file in the Safe Copies directory.

Use this when you need a sanitized on-disk copy (for storage, handoff, or archival) rather than an in-memory sanitized string. For the sanitized text only, use prepare_for_external_ai; for inspection-only use analyze_text; for reversing a prior session use restore_text.

Side effects: a new file is written to the directory set by SECUREDACT_SAFE_COPY_DIR. The supplied 'content' is not modified and no existing file is overwritten. The filename must be a bare '.txt' or '.md' basename (no path separators or directory traversal). The operation blocks and reports 'blocked' if the directory is unconfigured, the filename is invalid, or policy blocks the content.

Returns a JSON object with 'status' ('ok' or 'blocked'), 'filename', and 'counts'.

ParametersJSON Schema
NameRequiredDescriptionDefault
policyNoNamed redaction policy applied before writing. Defaults to 'strict_external_ai'. An unknown name returns a policy_not_found error.strict_external_ai
contentYesText to sanitize locally and write to disk. Processed on this machine; never transmitted.
filenameYesBare target filename (no directory components) ending in '.txt' or '.md'. The file is created inside the configured Safe Copies directory; an existing file is never overwritten.

Output Schema

ParametersJSON Schema
NameRequiredDescription

No output parameters

TDQS

A4.7/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are present, so the description carries the full burden—and it excels. It discloses side effects: writes a new file to SECUREDACT_SAFE_COPY_DIR, does not modify 'content', never overwrites an existing file, blocks with status 'blocked' under specific conditions, and returns a JSON structure. This is a thorough disclosure of behavior beyond the schema.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is well-structured: core action first, then usage guidance, then side effects, then return format. Each paragraph adds distinct value with no redundancy. Concise yet complete, and front-loaded with the most important decision-driving information.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's moderate complexity (3 parameters, no nested objects), an output schema exists (per signals), and the description itself explains side effects, blocking conditions, filename constraints, and return format. Nothing an agent needs to call it correctly is missing. The description is fully self-contained even without annotations.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so the schema fully describes all three parameters. The description adds practical context (e.g., filename must be bare, policy defaults to 'strict_external_ai', content is never transmitted) but does not materially enhance the semantic meaning beyond what the schema already provides. Baseline 3 is appropriate.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific action ('sanitize text locally and write the approved result to a new file'), names the resource ('Safe Copies directory'), and explicitly differentiates from all four siblings by naming them and the conditions under which each is preferred. An agent can immediately tell this tool writes a sanitized copy to disk.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The second paragraph gives explicit when-to-use guidance: 'Use this when you need a sanitized on-disk copy... rather than an in-memory sanitized string,' and names the alternative tools (prepare_for_external_ai, analyze_text, restore_text) with their complementary use cases. This fully eliminates ambiguity about tool selection.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

prepare_for_external_aiA

Use this before sending user-supplied or potentially sensitive text to an external AI service.

SecuRedact inspects and sanitizes the text locally and returns the policy-approved representation; this tool does not transmit the text externally. It is the recommended default for outbound AI workflows. Use analyze_text for inspection-only classifications, redact_text for the lower-level compatibility path, create_safe_copy when a sanitized file is required, and restore_text only to reverse a prior local session in a trusted context.

Returns a JSON object with 'status' ('ok', 'review_required', or 'blocked'), 'sanitized_text' (present only when approved), 'counts', 'policy', and optionally 'restoration_session' (when response_mode is 'restore_capable').

ParametersJSON Schema
NameRequiredDescriptionDefault
textYesFree text to inspect and sanitize locally before it is sent to an external AI service. All processing happens on this machine; this tool never transmits the text to any provider.
policyNoNamed redaction policy controlling which entity types are masked or blocked. Defaults to 'strict_external_ai'. Common values include 'strict_external_ai' and 'default'; other policies may be registered in your environment. An unknown name returns a policy_not_found error.strict_external_ai
languageNoHint for the contextual detection language. One of 'auto' (detect automatically), 'en', or 'nl'. Defaults to 'auto'.auto
response_modeNoAmount of detail returned. 'minimal' returns only the approved result and counts; 'review' adds per-detection findings for human review; 'debug' adds engine internals (only when debug responses are enabled); 'restore_capable' additionally returns a local restoration_session for later trusted restore_text. Defaults to 'minimal'.minimal

Output Schema

ParametersJSON Schema
NameRequiredDescription

No output parameters

TDQS

A4.5/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full transparency burden and does well by stating that the tool does not transmit text externally, operates locally, can return different statuses, and optionally creates a restoration session. It also discloses the policy_not_found error behavior. It could go slightly further on whether any local state or session data is persisted, but overall it is transparent for a sanitization tool.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is front-loaded with the primary use case, then a clear sibling-routing paragraph, then a concise output contract. Every sentence earns its place, and the structure makes it easy for an agent to scan quickly.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

The description covers when to use the tool, how it behaves, what alternatives exist, and what the return value looks like including statuses and optional fields. With a rich input schema and output schema present, nothing essential is missing for an agent to select and invoke it correctly.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, and the input schema already explains text, policy, language, and response_mode in detail. The description adds little new parameter-level meaning beyond the schema, but the schema is fully sufficient, so the baseline score of 3 is appropriate.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states a specific use case: preparing user-supplied or sensitive text before sending it to an external AI service, with local sanitization via SecuRedact. It clearly differentiates from siblings by naming each alternative and its purpose (analyze_text, redact_text, create_safe_copy, restore_text).

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

It explicitly recommends this tool as the default for outbound AI workflows and gives concrete routing rules: analyze_text for inspection-only, redact_text for lower-level compatibility, create_safe_copy when a file is needed, and restore_text only for reversing a prior local session. This leaves little ambiguity about when to choose it.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

redact_textA

Direct/lower-level redaction entry point; prefer prepare_for_external_ai for normal outbound workflows.

In its normal modes this performs the same local sanitization as prepare_for_external_ai and returns the approved result, so most agents should call prepare_for_external_ai instead. Use redact_text when you specifically need this lower-level compatibility path, or the 'legacy' mode for local review of raw redaction internals. The 'legacy' mode returns potentially sensitive local-review details and is never selected by default.

Returns, for normal modes, the same approved result as prepare_for_external_ai (status, sanitized_text, counts). For 'legacy' mode it returns a result with deprecation_code 'legacy_sensitive_response' containing local-review redaction data.

ParametersJSON Schema
NameRequiredDescriptionDefault
textYesFree text to redact locally. Processing is on this machine; nothing is transmitted externally.
policyNoNamed redaction policy controlling which entity types are masked or blocked. Defaults to 'default'. Common values include 'default' and 'strict_external_ai'; other policies may be registered. An unknown name returns a policy_not_found error.default
response_modeNoNormal modes behave like prepare_for_external_ai: 'minimal', 'review', and 'debug' return the approved result with increasing detail. The special value 'legacy' returns raw local-review redaction internals (including a mapping that reveals original values) under deprecation_code 'legacy_sensitive_response'; it must never be sent to an external service. Defaults to 'minimal'.minimal

Output Schema

ParametersJSON Schema
NameRequiredDescription

No output parameters

TDQS

A4.9/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden of behavioral disclosure. It transparently warns that legacy mode 'returns potentially sensitive local-review details' and 'must never be sent to an external service', and specifies the return contents (status, sanitized_text, counts) for normal modes. It also notes local processing, adding essential context about data handling.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is concisely structured: the first sentence directly states the routing preference, followed by a clear explanation of normal vs. legacy behavior, and finally the return contract. Every sentence earns its place, with no filler or repetition.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's three parameters and existing output schema, the description covers all necessary context: when to use it, what it returns, the special legacy mode with its sensitive nature, and the difference from its sibling. No critical information is missing for correct invocation.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so the baseline is 3. The description adds meaningful value for response_mode by clarifying that normal modes 'behave like prepare_for_external_ai' and that the legacy value exposes original values, which is not fully captured in the schema. This extra explanation helps an agent avoid misusing the sensitive legacy path.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly identifies this as a 'Direct/lower-level redaction entry point' and explicitly states it performs 'the same local sanitization as prepare_for_external_ai', distinguishing it from the preferred sibling. It names the action (redact), the resource (text), and explains the optional legacy mode, leaving no ambiguity about what the tool does.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description gives explicit guidance: 'prefer prepare_for_external_ai for normal outbound workflows' and 'Use redact_text when you specifically need this lower-level compatibility path, or the legacy mode'. It names the alternative tool and the precise conditions for choosing this one, fully satisfying the when/when-not requirement.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

restore_textA

Reverse a prior SecuRedact protection step in a trusted, local-only context.

Use this ONLY after you previously received a restoration_session from SecuRedact (for example from prepare_for_external_ai with response_mode 'restore_capable') and now need to reconstruct the original text locally for trusted review. Restoration can reveal the original sensitive values (PII, secrets, credentials); it is a trusted-local operation, not a step to prepare data for external transmission. Never call it to sanitize or prepare text for an external AI; for that use prepare_for_external_ai. Never call it on text you did not previously protect with SecuRedact.

Security boundary: all processing is local and nothing leaves the machine. The 'mapping' form requires trusted_local_review=true and exposes raw originals, so its output must never be transmitted. Returns a JSON object with 'status' ('ok' or 'blocked'), 'restored_text' (present only on success), and 'reason_codes' describing any failure.

ParametersJSON Schema
NameRequiredDescriptionDefault
textYesText containing SecuRedact placeholders (or a prior protected representation) to restore. Processed locally; never transmitted.
mappingNoLegacy direct mapping from placeholder token to original value. Supplying this bypasses the session vault and immediately reveals the original sensitive values. It is only honored when 'trusted_local_review' is true and 'restoration_session' is omitted.
restoration_sessionNoOpaque session token previously returned by SecuRedact (for example from prepare_for_external_ai with response_mode 'restore_capable'). It identifies the trusted local vault entry used to reverse protection and recover the original values. Required unless you supply 'mapping' together with trusted_local_review.
trusted_local_reviewNoExplicit acknowledgment that you are in a trusted local review context and accept that restoration reveals original sensitive values. Required (true) to use the 'mapping' form. It has no effect on the 'restoration_session' form.

Output Schema

ParametersJSON Schema
NameRequiredDescription

No output parameters

TDQS

A4.9/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description takes full responsibility for behavioral disclosure. It reveals that processing is entirely local and nothing leaves the machine, that the mapping form requires trusted_local_review=true and exposes raw originals that must never be transmitted, and it details the return format including 'status', 'restored_text', and 'reason_codes' for failures. This goes well beyond the schema and covers security-boundary concerns comprehensively.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is structured with a clear lead sentence stating the core action, followed by usage conditions and security boundary in a logical flow. Every sentence contributes new information—no redundancy or fluff—and the critical constraints (local-only, trusted-review) are front-loaded. The length is justified by the security-sensitive nature of the operation.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a security-sensitive restoration tool with no annotations and no explicit output schema details (though an output schema exists), the description is remarkably complete. It covers preconditions, security boundaries, parameter interactions, failure handling via reason_codes, and explicitly routes to the correct sibling for sanitization. Nothing an agent needs to call it correctly and safely is missing.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so the baseline is 3. However, the description enriches the parameters: it explains the mapping parameter as 'legacy direct mapping' that bypasses the session vault and immediately reveals originals, describes restoration_session as an opaque token identifying the trusted vault entry, and clarifies that trusted_local_review is an acknowledgment with no effect on the session form. These security-relevant semantics add value beyond the schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description uses a specific verb 'Reverse' and identifies the resource as 'a prior SecuRedact protection step', clearly stating the local trusted-review purpose. It explicitly distinguishes itself from sibling tools by warning against using it for external AI preparation and pointing to prepare_for_external_ai for that role, so it is immediately differentiated.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description gives explicit preconditions: use only after receiving a restoration_session from SecuRedact (e.g., from prepare_for_external_ai with response_mode 'restore_capable'), and never on text not previously protected. It also names the alternative tool and states the exact negative condition ('never call it to sanitize or prepare text for an external AI'), leaving no ambiguity about when to choose this tool.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

securedact_read_fileA

Safely read a local file and return only its sanitized (PII/secrets removed) text.

Use this when you must ingest a local file's contents for use with an external AI but want path-traversal, size, and binary defenses plus sanitization applied first. If the content is already in memory, use prepare_for_external_ai; for a sanitized file on disk, use create_safe_copy.

Side effects: reads a file from local disk and never transmits it. Sensitive paths and escapes are blocked before any file content is read. The returned 'sanitized_text' is safe to forward.

Returns a JSON object with 'status' ('ok' or 'blocked'), 'path', and 'sanitized_text' (present only when approved).

ParametersJSON Schema
NameRequiredDescriptionDefault
pathYesLocal filesystem path to read. It is resolved and defended against path traversal, symlink/UNC escapes, and oversized or binary content (FW-011/012/013); sensitive paths are blocked before any file content is read.
policyNoNamed redaction policy applied to the file contents. Defaults to 'strict_external_ai'. An unknown name returns a policy_not_found error.strict_external_ai
max_bytesNoOptional cap on the number of bytes read from the file. When omitted, the engine's configured size limit applies.

Output Schema

ParametersJSON Schema
NameRequiredDescription

No output parameters

TDQS

A4.7/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description fully owns behavioral disclosure. It spells out side effects (reads file, never transmits), the defense order (sensitive paths and escapes blocked before reading), and the return structure. It even notes sanitized_text is safe to forward. This is thorough and anticipates an agent's security and safety questions.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is well-structured: purpose sentence, usage trigger, alternatives, side-effects, and return format. Every sentence serves a distinct function with no redundancy. The most important info (what it does and when to use it) is front-loaded.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the output schema is present, all return fields are covered. The description addresses security, policy defaults, size limits, and side effects. There is nothing an agent needs to know to call this tool correctly that is missing or ambiguous.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema already documents all three parameters. The tool description itself does not add new meaning beyond what's in the schema, but it does echo the security posture (e.g., path defenses). Baseline 3 is appropriate because the schema carries the load and the description adds no extra helpful nuance.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description opens with a specific verb and resource: 'Safely read a local file and return only its sanitized text.' It clearly distinguishes from siblings by naming prepare_for_external_ai (in-memory content) and create_safe_copy (sanitized file on disk), so the agent can immediately tell which tool to use.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

It explicitly states the condition for use: 'when you must ingest a local file's contents for use with an external AI' and gives two alternatives with the contexts under which those would be preferred. This is direct routing guidance.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

  1. 6 tool updatesv0.4.2
    • Changedanalyze_text3 fields changed
      • addedInput schema / properties / policy / description
        Added value: +"Named analysis policy controlling which detectors and entity types apply. Defaults to 'default'. Common values include 'default'; other policies may be registered in your environment. An unknown name returns a policy_not_found error."
      • addedInput schema / properties / response_mode / description
        Added value: +"Level of detail returned. 'minimal' returns only status and entity-type counts; 'review' additionally returns a 'findings' list with spans and entity types; 'debug' additionally returns 'debug_details' (only when debug responses are enabled). Defaults to 'minimal'."
      • addedInput schema / properties / text / description
        Added value: +"Free text to inspect locally for sensitive content. Processing is on this machine only; the original text is never modified or transmitted."
    • Changedcreate_safe_copy3 fields changed
      • addedInput schema / properties / content / description
        Added value: +"Text to sanitize locally and write to disk. Processed on this machine; never transmitted."
      • addedInput schema / properties / filename / description
        Added value: +"Bare target filename (no directory components) ending in '.txt' or '.md'. The file is created inside the configured Safe Copies directory; an existing file is never overwritten."
      • addedInput schema / properties / policy / description
        Added value: +"Named redaction policy applied before writing. Defaults to 'strict_external_ai'. An unknown name returns a policy_not_found error."
    • Changedprepare_for_external_ai4 fields changed
      • addedInput schema / properties / language / description
        Added value: +"Hint for the contextual detection language. One of 'auto' (detect automatically), 'en', or 'nl'. Defaults to 'auto'."
      • addedInput schema / properties / policy / description
        Added value: +"Named redaction policy controlling which entity types are masked or blocked. Defaults to 'strict_external_ai'. Common values include 'strict_external_ai' and 'default'; other policies may be registered in your environment. An unknown name returns a policy_not_found error."
      • addedInput schema / properties / response_mode / description
        Added value: +"Amount of detail returned. 'minimal' returns only the approved result and counts; 'review' adds per-detection findings for human review; 'debug' adds engine internals (only when debug responses are enabled); 'restore_capable' additionally returns a local restoration_session for later trusted restore_text. Defaults to 'minimal'."
      • addedInput schema / properties / text / description
        Added value: +"Free text to inspect and sanitize locally before it is sent to an external AI service. All processing happens on this machine; this tool never transmits the text to any provider."
    • Changedredact_text3 fields changed
      • addedInput schema / properties / policy / description
        Added value: +"Named redaction policy controlling which entity types are masked or blocked. Defaults to 'default'. Common values include 'default' and 'strict_external_ai'; other policies may be registered. An unknown name returns a policy_not_found error."
      • addedInput schema / properties / response_mode / description
        Added value: +"Normal modes behave like prepare_for_external_ai: 'minimal', 'review', and 'debug' return the approved result with increasing detail. The special value 'legacy' returns raw local-review redaction internals (including a mapping that reveals original values) under deprecation_code 'legacy_sensitive_response'; it must never be sent to an external service. Defaults to 'minimal'."
      • addedInput schema / properties / text / description
        Added value: +"Free text to redact locally. Processing is on this machine; nothing is transmitted externally."
    • Changedrestore_text4 fields changed
      • addedInput schema / properties / mapping / description
        Added value: +"Legacy direct mapping from placeholder token to original value. Supplying this bypasses the session vault and immediately reveals the original sensitive values. It is only honored when 'trusted_local_review' is true and 'restoration_session' is omitted."
      • addedInput schema / properties / restoration_session / description
        Added value: +"Opaque session token previously returned by SecuRedact (for example from prepare_for_external_ai with response_mode 'restore_capable'). It identifies the trusted local vault entry used to reverse protection and recover the original values. Required unless you supply 'mapping' together with trusted_local_review."
      • addedInput schema / properties / text / description
        Added value: +"Text containing SecuRedact placeholders (or a prior protected representation) to restore. Processed locally; never transmitted."
      • addedInput schema / properties / trusted_local_review / description
        Added value: +"Explicit acknowledgment that you are in a trusted local review context and accept that restoration reveals original sensitive values. Required (true) to use the 'mapping' form. It has no effect on the 'restoration_session' form."
    • Addedsecuredact_read_file
  2. 5 tool updatesv0.2.0
    • Changedanalyze_text1 field changed
      • addedInput schema / properties / response_mode
        Added value: +{
        +  "default": "minimal",
        +  "title": "Response Mode",
        +  "type": "string"
        +}
    • Changedcreate_safe_copy1 field changed
      • changedInput schema / properties / policy / default
        Previous value: -"default"New value: +"strict_external_ai"
    • Addedprepare_for_external_ai
    • Changedredact_text1 field changed
      • addedInput schema / properties / response_mode
        Added value: +{
        +  "default": "minimal",
        +  "title": "Response Mode",
        +  "type": "string"
        +}
    • Changedrestore_text11 fields changed
      • removedInput schema / properties / mapping / additionalProperties
        Removed value: -{
        -  "type": "string"
        -}
      • addedInput schema / properties / mapping / anyOf
        Added value: +[
        +  {
        +    "additionalProperties": {
        +      "type": "string"
        +    },
        +    "type": "object"
        +  },
        +  {
        +    "type": "null"
        +  }
        +]
      • addedInput schema / properties / mapping / default
        Added value: +null
      • removedInput schema / properties / mapping / type
        Removed value: -"object"
      • addedInput schema / properties / restoration_session
        Added value: +{
        +  "anyOf": [
        +    {
        +      "type": "string"
        +    },
        +    {
        +      "type": "null"
        +    }
        +  ],
        +  "default": null,
        +  "title": "Restoration Session"
        +}
      • addedInput schema / properties / trusted_local_review
        Added value: +{
        +  "default": false,
        +  "title": "Trusted Local Review",
        +  "type": "boolean"
        +}
      • changedInput schema / required
        Previous value: -[
        -  "text",
        -  "mapping"
        -]New value: +[
        +  "text"
        +]
      • addedOutput schema / additionalProperties
        Added value: +true
      • removedOutput schema / properties
        Removed value: -{
        -  "result": {
        -    "title": "Result",
        -    "type": "string"
        -  }
        -}
      • removedOutput schema / required
        Removed value: -[
        -  "result"
        -]
      • changedOutput schema / title
        Previous value: -"restore_textOutput"New value: +"restore_textDictOutput"
  3. 4 tool updatesv0.1.0
    • First observedanalyze_text
    • First observedcreate_safe_copy
    • First observedredact_text
    • First observedrestore_text

TDQS

A4.6/5.0

Scored across 6 tools

Disambiguation4/5

Most tools have clearly distinct purposes (analyze, restore, create, read file), but redact_text is explicitly described as a lower-level compatibility path that performs the same sanitization as prepare_for_external_ai, which could cause misselection if an agent reads only the names. The detailed descriptions mitigate this ambiguity, keeping it to just one confusing pair.

Naming Consistency4/5

All tool names use snake_case and mostly follow a verb_noun pattern (analyze_text, redact_text, restore_text, create_safe_copy). prepare_for_external_ai and securedact_read_file deviate slightly—one uses a longer phrase and the other has a product-name prefix—but the overall style remains predictable and readable.

Tool Count5/5

With 6 tools, the server is well-scoped for its purpose of text sanitization and file handling. Each tool covers a distinct workflow step (inspect, sanitize, restore, file read/write), and the count is within the ideal 3-15 range without being bloated or sparse.

Completeness5/5

The tool surface covers the full lifecycle of sensitive text handling: sanitizing for external AI, inspection-only analysis, lower-level redaction, restoration, creating safe copies, and reading files safely. No obvious dead ends or missing operations for the stated domain; the additional file-oriented tools fill a practical gap.

Maintenance

ActivityActive
ResponsivenessNo issues

Related MCP Connectors

Related MCP Servers

  • A
    license
    A
    quality
    A
    maintenance
    An MCP server that redacts PII/PHI from text before it ever reaches an LLM — self-hosted, fail-closed, and HIPAA-aware.
    3
    MIT
  • A
    license
    A
    quality
    B
    maintenance
    MCP server providing on-prem PII detection and anonymization tools (scan and is_sensitive) for AI agents, ensuring data stays local.
    4
    MIT
  • A
    license
    A
    quality
    B
    maintenance
    MCP server for local, verifiable PDF redaction. Enables AI agents to find sensitive regions, locate text, redact PDFs on-device, verify redaction and tamper-evidence seals, and generate PDFs—without uploading confidential documents.
    8
    299
    -