Agent Harness Tutorial · Tech stack
PV · Privacy & data protection
Personal data used only for this case, kept in India, masked, and forgotten on request. Family: Control · one turn, in order.
Why our choiceRedaction, entitlement and erasure are domain rules we code once. Azure supplies residency and encryption.
| Option | Where from | Verdict | Why |
|---|---|---|---|
| redact() in telemetry | ours | ✓ chosen | Aadhaar, PAN, licence, accounts |
| no_pii_echo rule | ours | ✓ chosen | on every reply |
| India regions | ours | ✓ chosen | Central + South India |
| forget() + 30-day retention | ours | ✓ chosen | built, not scheduled |
| AI Language (PII) | Azure | ◐ planned | in the design, not deployed |
| Encryption at rest, private endpoints | Azure | ◐ planned | in the design |
| Presidio | open source | · considered | to decide: the model needs some ids |
How it works inside the harness: The trace.
Compared: How is personal data found and masked?
| Option | From | Verdict | Where it runs | India IDs (Aadhaar, PAN) | Network call | Handles free text | Status |
|---|---|---|---|---|---|---|---|
| Regex redact() (ours) | ours | chosen | every payload and log line | yes, Aadhaar Verhoeff-checked | none | known patterns only | built |
| no_pii_echo reply rule | ours | chosen | post_model and reply | yes | none | known patterns only | built |
| Microsoft Presidio | open source | to decide | in our process (spaCy) | built-in IN_PAN, IN_AADHAAR | none | yes: names, places | to decide: model needs IDs |
| Azure AI Language PII | Azure | planned | Azure service | yes, India entity types | yes | yes | design: mask before model |
DecisionOur regex redact() and the no_pii_echo rule are built and cover the identifiers that matter, on every log line and every reply. Masking before the model, with Presidio or Azure AI Language, is still to decide because the model sometimes needs the identifiers.
How it is done: the real code
Cut from the live repositories each time the site is built, so it always matches what runs.
def redact(text: str, *, limit: int = 4000) -> str:
"""The single redaction point. Everything captured onto a span comes here.
Deliberately crude: deterministic regexes, no model call, no network. A
detector that can be wrong slowly is worse than one that is obviously
approximate — this is a floor, not a compliance control.
"""
for pattern, replacement in (*_LIBRARY, *_registered):
text = pattern.sub(replacement, text)
if len(text) > limit:
return text[:limit] + f"…[truncated {len(text) - limit} chars]"
return text