Ogentic-ShieldScanning sensitivity
0/ 100
Loading recognizers000%
ogentic·shield
Open source · Apache-2.0 · v0.5.0

Know what's
privileged before
it reaches the model

A regulatory-sensitivity classifier for AI applications. It reads text on-device, flags what must never leave, and tells your app where it's safe to send.

Offline by default30 recognizersExtends Presidio480+ testsPython 3.10+
Scroll to analyze
Live

Watch it read a privileged memo.

Redaction bars fall over the sensitive spans, the sensitivity score settles, and a routing verdict comes back — all before a single character could leave the device. Hover any bar to see the entity behind it.

shield.analyze(text, profile="shield-legal")on-device
Input · legal memo

Per our conversation with outside counsel at Davis Polk regarding the SEC investigation, this memo is privileged and confidential.

0
/ 100 · sensitivity
LevelCRITICAL
RouteLOCAL_ONLY
Profileshield-legal
COUNSEL_COMMUNICATIONLAW_FIRM_NAMELITIGATION_MARKERPRIVILEGE_MARKER
Why it exists

The moment text leaves the device, the duty of confidentiality is already tested.

US v. Heppner (S.D.N.Y., Feb 2026) held that sending content to public AI tools waives attorney-client privilege. The same logic extends to HIPAA-PHI, SEC/FINRA material non-public information, and every regulated profession with a duty of confidentiality.

30M+

US professionals use AI tools every day.

71%

of law firms have no written AI policy.

43%

of therapists have entered patient data into public AI.

0

open-source tools answered "should this leave the device?" — until Shield.

What it is

A classifier, not an enforcer.

Microsoft Presidio detects general PII — names, SSNs, credit cards. It knows nothing about privilege markers, psychotherapy notes, or MNPI. Shield extends Presidio with 30 domain-specific recognizers and returns three things your app can act on. You keep the routing decision.

01 · DETECT

Entities + confidence

Every match, its category, character span, and a calibrated confidence — Presidio's 50+ PII types plus Shield's domain recognizers, deduplicated.

PRIVILEGE_MARKER · 0.95
LAW_FIRM_NAME · 0.97
02 · SCORE

Score + sensitivity level

A profile-weighted 0–100 score mapped to NONE / LOW / MEDIUM / HIGH / CRITICAL. Weights are composable across profiles; the higher weight wins.

score: 94
level: CRITICAL
03 · ROUTE

Routing suggestion

An advisory verdict — CLOUD_OK, REDACT_CLOUD, or LOCAL_ONLY. Privilege and MNPI always force LOCAL_ONLY; PHI is REDACT_CLOUD at minimum.

routing: LOCAL_ONLY
Scenarios

The same three lines, across three regulated worlds.

Pick a domain. Shield runs the same pipeline; the profile decides what counts as sensitive and how heavily it weighs. Hover any redaction bar to see the entity behind it.

shield.analyze(text, profile="shield-legal")on-device
Input · legal memo

Per our conversation with outside counsel at Davis Polk regarding the SEC investigation, this memo is privileged and confidential.

0
/ 100 · sensitivity
LevelCRITICAL
RouteLOCAL_ONLY
Profileshield-legal
COUNSEL_COMMUNICATIONLAW_FIRM_NAMELITIGATION_MARKERPRIVILEGE_MARKER
Legal profile

Everything sensitive, gated at the source.

Shield returned a CRITICAL sensitivity score of 94, so the advisory verdict is LOCAL_ONLY. Your app decides what to do with that — route local, redact, or send.

COUNSEL_COMMUNICATIONLAW_FIRM_NAMELITIGATION_MARKERPRIVILEGE_MARKER

// Example inputs and outputs are illustrative of documented behaviour. Load multiple profiles at once for cross-domain matters.

Detection pipeline

Three layers. Two of them never touch the network.

Layers run in strict order and each can only refine what came before. Layer 3 is opt-in, localhost-only, and fires only when the score is genuinely ambiguous.

Layer 1< 50 ms

Regex + NER

The Presidio engine with 30 custom recognizers as first-class citizens. Overlapping spans are deduplicated by length, then confidence, then category priority.

zero network calls
Layer 2< 10 ms

Context-aware rules

Confidence boosting via co-occurrence — “privileged” near “counsel” inside a character window is stronger evidence than either alone. Entities are immutable.

zero network calls
Layer 3 · opt-inlocalhost

Local LLM

Localhost Ollama only — never a cloud API. Profile-tuned prompts, structured JSON output, retry with graceful fallback. Disabled by default; air-gapped-safe.

localhost Ollama · never cloud
ScoreLevelRouting suggestion
0NONECLOUD_OK
1–20LOWCLOUD_OK
21–50MEDIUMREDACT_CLOUD
51–80HIGHREDACT_CLOUDLOCAL_ONLY
81–100CRITICALLOCAL_ONLY

// Any PRIVILEGE or MNPI entity forces LOCAL_ONLY regardless of score. PHI is REDACT_CLOUD at minimum.

Shield profiles

Ten recognizers each. Composable by design.

A profile bundles recognizers, context rules, and scoring weights for one domain. Load one, or several — a firm handling healthcare litigation loads legal and therapy together.

shield-legal

Attorney-client privilege

Privilege markers, counsel communications, work-product doctrine, and litigation-sensitive content.

  • PRIVILEGE_MARKER
  • COUNSEL_COMMUNICATION
  • WORK_PRODUCT
  • SETTLEMENT_TERMS
  • CASE_NUMBER
  • LAW_FIRM_NAME
  • LITIGATION_MARKER
  • COURT_FILING
  • BATES_NUMBER
  • EXECUTIVE_NAME
weights · PRIVILEGE 30 · PII 15 · CONFIDENTIAL 10
shield-therapy

HIPAA PHI & clinical risk

Protected health information, psychotherapy-note indicators, diagnosis codes, and clinical risk flags.

  • PATIENT_NAME
  • DATE_OF_BIRTH
  • DIAGNOSIS_CODE
  • CLINICAL_RISK_FLAG
  • SESSION_MARKER
  • INSURANCE_ID
  • MEDICATION
  • PROVIDER_NAME
  • SSN
  • PSYCHOTHERAPY_NOTE_MARKER
weights · PHI 28 · PII 15 · CONFIDENTIAL 10
shield-finance

MNPI & deal terms

Material non-public information, M&A activity, deal terms, fund information, and insider markers.

  • MNPI_MARKER
  • MA_ACTIVITY
  • DEAL_VALUE
  • LEVERAGE_RATIO
  • FUND_INFORMATION
  • INSTITUTION_NAME
  • FINANCIAL_TERMS
  • DISTRIBUTION_RESTRICTION
  • INSIDER_MARKER
  • CARRY_TERMS
weights · MNPI 30 · PII 12 · CONFIDENTIAL 10
Case studies

Where a sensitivity gate changes the workflow.

Representative deployment patterns for the three profiles. Each puts Shield in front of an AI step so privileged content is caught before it can be sent.

Litigation boutique

An internal chatbot that can't leak a memo

01Every prompt is classified with shield-legal before it leaves the app.
02LOCAL_ONLY verdicts route to an on-prem model; CLOUD_OK goes to the frontier API.
03The verdict + entities are written to an ogentic-audit trail for defensibility.
Privileged memos never reach a public model — and there's a record that proves it.LOCAL_ONLY
Behavioral-health group practice

A note-taking assistant that keeps HIPAA posture

01Progress notes are scanned with shield-therapy on the clinician's device.
02PHI and clinical-risk flags (SI, self-harm) push the note to REDACT_CLOUD or LOCAL_ONLY.
03Only de-identified, non-sensitive text is ever eligible for a cloud summary.
Patient names, DOB, diagnoses and risk language are gated at the source.REDACT_CLOUD
Private-credit deal desk

Deal chatter that stays inside the wall

01Memos and Slack drafts are checked with shield-finance before any AI summarization.
02MNPI markers, deal values and 'do not distribute' language force LOCAL_ONLY.
03Blackout-period content is flagged before it can reach an external tool.
Insider-sensitive material is classified before it becomes a compliance event.LOCAL_ONLY

Illustrative deployment patterns, not customer testimonials. Shield is a classifier — routing and enforcement are performed by the consuming application (e.g. ogentic-router).

Sample projects

From three lines to a deployed service.

Shield ships as a library, a CLI, an MCP server, and a FastAPI service — plus runnable examples for custom recognizers. Everything below is real API surface.

quickstart.pyLibrary
from ogentic_shield import Shield

shield = Shield(profiles=["shield-legal"])
result = shield.analyze(
    "Per our conversation with outside counsel at Davis Polk "
    "regarding the SEC investigation, this is privileged."
)

result.score               # 94
result.sensitivity_level   # CRITICAL
result.routing_suggestion  # LOCAL_ONLY
terminalCLI
# analyze text with a Rich table
$ ogentic-shield analyze "privileged and confidential" \
    --profiles shield-legal --output table

# pipe JSON into anything
$ cat memo.txt | ogentic-shield analyze --output json
batch + asyncScale
# per-item error containment, parallelized
results = shield.analyze_batch(documents)

# non-blocking, for a responsive UI
async for chunk in AsyncShield().analyze_stream(text):
    render(chunk)
mcp_serverMCP
# five async tools over the Model Context Protocol
shield.analyze        # classify one string
shield.analyze_batch  # classify many
shield.redact         # mask detected spans
shield.unredact       # restore from a token map
shield.profiles       # introspect what's loaded
deploy/app.pyHTTP · FastAPI
# Railway-ready sensitivity endpoint
POST /analyze   # {text, profiles} -> score, level, route
GET  /health    # readiness probe
GET  /          # service banner + endpoints
examples/custom_profile.pyExtend
class GDPRRecognizer(PatternRecognizer):
    """Your domain, your recognizers."""
    PATTERNS = [Pattern("eu_id", r"...", 0.9)]

# drop it into a profile and score alongside the built-ins
Shield(profiles=[my_profile]).analyze(text)
The ogentic stack

Shield detects. The rest of the primitives compose around it.

Seven Apache-2.0 libraries that snap together into a privacy-first pipeline — and form the foundation for Sotto, OgenticAI's product for regulated professionals.

shield
Detects sensitivity
PyPI · v0.5
redact
Structure-aware redaction
soon
router
Privacy-aware routing
soon
audit
Tamper-evident trails
soon
convert
Synthesis primitives
planned
vault
Local encrypted store
planned
adapter-sdk
Contracts
planned

shield → router → audit · classify, then route, then log. Together they form a complete open-source stack for privilege-protected AI — the foundation for Sotto ↗.

Get started in 30 seconds

Install it. Analyze in three lines.

Requires Python 3.10+ and a spaCy model for NER. No account, no key, no telemetry.