You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Integration]: Sequencer middleware.pii_mask step op #58
Implement middleware.pii_mask sequencer step, basically redact email/phone/key-like patterns at step boundaries, and emit middleware.applied on spine. Documented in ops README, not yet implemented.
While the intent is clear, turning this into a production-grade feature requires bridging AURA's core design tenets with enterprise PII standards (NIST SP 800-122, GDPR Art. 32, HIPAA Safe Harbor).
Currently, AURA has:
Key-name payload redaction (aura.core.payload_redaction): Redacts known credential key names (token, api_key, password) on spine emit.
Middleware schema stub (spec/middleware-policy.schema.json & aura.sequencer.middleware): Declares scope: per_step and order: [{op: "...", config: ...}], but MiddlewareStack._invoke is an empty pass-through stub.
The Problem in Agentic Workflows:
In multi-step autonomous pipelines, PII (emails, phone numbers, SSNs, credit cards, physical addresses) rarely lives in predictable key names. It appears inside unstructured text payloads (eg. customer support transcripts, scraped docs, user queries, SQL query parameters). If Step 1 retrieves customer records and Step 2 calls an untrusted third-party tool or cloud LLM, unmasked PII leaks across security boundaries and pollutes the audit spine.
AURA is an architectural "runtime coat" designed to be lightweight, fast, and host-agnostic (dependencies = ["pyyaml"]). We should not hard-code a 270M parameter Transformer model (eg. ARPA's own micro-f1-mask) or heavy NLP framework directly into AURA's base dependencies.
For enterprise and regulated environments requiring contextual Named Entity Recognition (names of persons, organizations, medical terms, physical addresses).
pseudonymize / tokenize (Essential for Agentic Reasoning):
If an agent is executing a multi-step investigation on customer alice@corp.com, redacting to generic [EMAIL] destroys the LLM's ability to correlate Alice across Step 2 and Step 3.
Pseudonymization creates a session-scoped HMAC token (e.g. <EMAIL_REF_a1b2>), preserving entity equivalence across steps without revealing the true plaintext PII!
Pipeline Invocation Models
middleware.pii_mask should be usable in two complementary ways:
A. Automatic Boundary Middleware (scope: per_step)
Configured on the sequencer policy to automatically sanitize data moving between steps:
At spectrum.level: low / mid: Redact/mask and proceed with middleware.applied.
At spectrum.level: high / full: Configurable strict: true mode can emit constraint.violated / finding: PII_DETECTED if sensitive PII is encountered in an unapproved boundary.
Activity
rosspeili commentedon Oct 11, 2026
Context & Architectural Motivation
Issue #58 originally stated:
While the intent is clear, turning this into a production-grade feature requires bridging AURA's core design tenets with enterprise PII standards (NIST SP 800-122, GDPR Art. 32, HIPAA Safe Harbor).
Currently, AURA has:
aura.core.payload_redaction): Redacts known credential key names (token,api_key,password) on spine emit.spec/middleware-policy.schema.json&aura.sequencer.middleware): Declaresscope: per_stepandorder: [{op: "...", config: ...}], butMiddlewareStack._invokeis an empty pass-through stub.The Problem in Agentic Workflows:
In multi-step autonomous pipelines, PII (emails, phone numbers, SSNs, credit cards, physical addresses) rarely lives in predictable key names. It appears inside unstructured text payloads (eg. customer support transcripts, scraped docs, user queries, SQL query parameters). If Step 1 retrieves customer records and Step 2 calls an untrusted third-party tool or cloud LLM, unmasked PII leaks across security boundaries and pollutes the audit spine.
Recommended Architecture: Two-Tier Pluggable Engine
AURA is an architectural "runtime coat" designed to be lightweight, fast, and host-agnostic (
dependencies = ["pyyaml"]). We should not hard-code a 270M parameter Transformer model (eg. ARPA's ownmicro-f1-mask) or heavy NLP framework directly into AURA's base dependencies.Instead, we should adopt a two-tier architecture:
Tier 1: Built-in Engine (
NativePiiMasker)re).Tier 2: Pluggable Provider Protocol (
PiiMaskerProvider)pii_maskerskill or host tool.on_error: fallback | fail | pass.Three Core Masking Strategies
Industry best practice (NIST SP 800-122 & GDPR) dictates that masking cannot be one-size-fits-all. AURA should support three strategies:
redact(Default): Complete replacement with entity tags:"Contact john@corp.com at 555-0199"→"Contact [EMAIL] at [PHONE]"mask(Partial obfuscation for operational legibility):"john.doe@corp.com"→"j***e@corp.com","4111111111111234"→"****-****-****-1234"pseudonymize/tokenize(Essential for Agentic Reasoning):alice@corp.com, redacting to generic[EMAIL]destroys the LLM's ability to correlate Alice across Step 2 and Step 3.<EMAIL_REF_a1b2>), preserving entity equivalence across steps without revealing the true plaintext PII!Pipeline Invocation Models
middleware.pii_maskshould be usable in two complementary ways:A. Automatic Boundary Middleware (
scope: per_step)Configured on the sequencer policy to automatically sanitize data moving between steps:
B. Explicit Sequencer Pipeline Step (
type: op)Used when a pipeline wants a discrete, audited transformation step in its DAG:
Audit Spine Contract & Telemetry
AURA's core rule: The audit spine must never record the raw secret or PII.
When masking occurs, emit
middleware.applied(orsequencer.middleware.applied):{ "op": "middleware.pii_mask", "step_id": "sanitize_step", "provider": "native_regex", "strategy": "redact", "entities_detected": { "email": 2, "phone": 1, "credit_card": 0 }, "total_redactions": 3, "fields_modified": ["args.user_text", "args.query"] }spectrum.level: low/mid: Redact/mask and proceed withmiddleware.applied.spectrum.level: high/full: Configurablestrict: truemode can emitconstraint.violated/finding: PII_DETECTEDif sensitive PII is encountered in an unapproved boundary.Proposed Scope of Work & Deliverables
aura/sequencer/pii_mask.py:NativePiiMasker: Stdlib regex + Luhn-validated engine supportingredact,mask, andpseudonymize.PiiMaskerProviderprotocol for pluggable backends.aura/sequencer/middleware.py:MiddlewareStack._invoketo dispatch registered ops (starting withmiddleware.pii_mask).SequencerRunner._run_step.aura/sequencer/runner.py:type: op, ref: middleware.pii_maskexecution inStepBackend.run_op.middleware.appliedon the session spine with metadata only (zero PII leakage).integrations/skillware/pii_adapter.py: Bridge to Skillwarepii_masker/micro-f1-maskif installed.tests/test_sequencer_pii_mask.py: Unit tests for regex, Luhn check, strategies, nested data, and spine telemetry.examples/06-skillware-sequencer-chainorexamples/04-sequencer-pipeline.docs/sequencer.mdanddocs/outputs.md.feat(sequencer): middleware.pii_mask op and boundary stack (#58) (#90)
rosspeili commentedon Oct 15, 2026
closing as done by #90