keysweep_scan_text
keysweep_scan_text(text: string)
Inspects supplied text for exposed secrets: API keys, tokens, private keys, credentials, and database URLs. Pure analysis of the submitted content — the tool performs no network access.
- Operation typeAnalytical. Read-only inspection of the supplied text; no network access. Scan activity is written to the service audit log on a best-effort basis; authentication and entitlement checks run before the service; failures of those checks produce security telemetry.
- Parameters
text— required string. Must be non-empty after trimming; maximum 256,000 characters. - Output
status,risk_level,confidence_score,summary(withtotal,by_severity,by_type),detections(each withtype,severity,confidence,fingerprint,value_length), andtext_length. - Error behaviorExpected failures — validation, quota, binding, and scan failures inside the service layer — return a structured MCP tool error (an
is_errorresult) whose message carries a stable, machine-readable code (the SDK prefixes tool error messages with the tool's name) — never a transport-level 500. An unexpected infrastructure failure may surface without such a code; anis_errorresult is a failure regardless. Argument-shape failures are handled by the SDK before the tool runs, and transport-layer authentication failures (for example a missing bearer credential) fail before any tool invocation. Codes include:invalid_text,text_too_large,rate_limit_exceeded,quota_unavailable,scan_failed,db_scope_unavailable,db_role_unavailable,binding_check_unavailable,credential_binding_failed. When a call reaches a tool without a resolved identity it yieldsunauthenticated; a credential without this tool's entitlement yieldsforbidden. - Security noteCredential-gated: the bearer credential must carry the
keysweep_scan_textentitlement. Output is redacted — detected secret values are never returned; findings carry only type, severity, confidence, a truncated fingerprint, and the secret's length. - Example useScreen code, configs, logs, or messages for leaked credentials before an agent stores, forwards, or acts on them.