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:60

Mark a Zod schema as sensitive. Returns the same schema instance — the marker is stamped on the schema's definition, so the static type is preserved, the call site reads as a pure annotation, and the marker survives any refinement chained after the call.

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.

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
});