Expression building blocks
Policies may reference:- Marked fields. Any column or map key marked as
policy, with logical typestring,string_array, orboolean. Number fields are filter-only and rejected in policies. - User attributes. Valid keys added to users, such as
tenant_idanduser_id, resolved from the caller and made policy-referenceable automatically. - Literal values. Strings, string lists, and booleans.
Worked examples
The examples below assume scalar span attributes inSpanAttributes, array attributes in SpanArrayAttributes, and a promoted ServiceName column. Mark each referenced trace field as policy; user attributes become available when they are added to a user.
The
gen_ai.* names follow the OpenTelemetry GenAI semantic conventions.
String array semantics
String array membership is exact:"agent:pii" does not match "agent:pii-reviewed". Mark array-typed fields with logical_type: string_array before referencing them in a policy.
What LightShip does not do
- No content classification or redaction. LightShip does not classify or redact data itself.
- No span hiding. LightShip does not hide individual spans inside an authorized trace; a matching span makes the complete trace visible.
- No number policies. Number fields are filter-only. The policy profile deliberately rejects them.
Related topics
Roles and policies
Create, replace, and delete roles through the API or Setup UI.
Filters
Compare policy expressions to their JSON filter equivalents.