Skip to main content
Version: Current

sensitive

@rotorsoft/act-root


@rotorsoft/act-root / act/src / sensitive

Function: sensitive()

sensitive<T>(schema): T

Defined in: libs/act/src/types/schemas.ts:56

Mark a Zod schema as sensitive. Returns the same schema instance โ€” the marker is registered out-of-band so the static type is preserved and the call site reads as a pure annotation.

Idempotent: re-wrapping an already-sensitive schema is a no-op.

The marker is what the orchestrator inspects to split event payloads into data + pii on commit, gate reads via .discloses, and strip handler payloads. Part of the sensitive-data foundation (#855 / epic #566).

Type Parametersโ€‹

Tโ€‹

T extends ZodType<unknown, unknown, $ZodTypeInternals<unknown, unknown>>

Parametersโ€‹

schemaโ€‹

T

The Zod schema to mark sensitive.

Returnsโ€‹

T

The same schema instance, unmodified at the type level.

Exampleโ€‹

import { z } from "zod";
import { state, sensitive } from "@rotorsoft/act";

const UserRegistered = z.object({
email: sensitive(z.string()),
name: sensitive(z.string()),
plan: z.enum(["free", "pro"]), // not sensitive โ€” stays in events.data
});