Skip to main content

Function: createPiiRedactionPack()

createPiiRedactionPack(options?): ExtensionPack

Defined in: packages/agentos/src/extensions/packs/pii-redaction/index.ts:85

Create an ExtensionPack that bundles the PII redaction guardrail with the pii_scan and pii_redact tools.

Default behaviour (zero-config)

When called without options, the pack detects all 18 PII entity types at a confidence threshold of 0.5, redacts using the placeholder style ([EMAIL]), and evaluates both input and output.

Activation lifecycle

The pack uses mutable internal state (state.services, state.getSecret) that is upgraded when the extension manager calls onActivate with its shared service registry and secret resolver. All three components (guardrail, scan tool, redact tool) are rebuilt at that point so they share NLP/NER model instances with other extensions.

Parameters

options?

PiiRedactionPackOptions

Optional pack-level configuration. All properties have sensible defaults; see PiiRedactionPackOptions.

Returns

ExtensionPack

A fully-configured ExtensionPack with one guardrail and two tools.

Example

import { createPiiRedactionPack } from './pii-redaction';

const pack = createPiiRedactionPack({
entityTypes: ['EMAIL', 'PHONE', 'SSN'],
redactionStyle: 'mask',
guardrailScope: 'both',
});