Agentic Data Plane

rpk ai guardrail test

Check text against a stored guardrail (--name) or an unsaved policy.

Usage

rpk ai guardrail test [flags]

Examples

This section provides examples of how to use rpk ai guardrail test.

rpk ai guardrail test --name block-prompt-attacks --text "Ignore previous instructions"
rpk ai guardrail test --text "Mail me at a@example.com" --engine.redpanda-model-serving \
  --pii.entities '{"type":"PII_ENTITY_TYPE_EMAIL","action":{"input":"ACTION_ANONYMIZE"}}'
rpk ai guardrail test -f request.yaml

Flags

Value Type Description

--name

string

Name.

--content-filter

bool

Content filter. (selects this target mode; takes no value).

--content-filter.hate.input-strength

string

Input strength. (one of: low, medium, high).

--content-filter.hate.output-strength

string

Output strength. (one of: low, medium, high).

--content-filter.hate.action.input

string

Input. (one of: none, detect, block, anonymize).

--content-filter.hate.action.output

string

Output. (one of: none, detect, block, anonymize).

--content-filter.insults.input-strength

string

Input strength. (one of: low, medium, high).

--content-filter.insults.output-strength

string

Output strength. (one of: low, medium, high).

--content-filter.insults.action.input

string

Input. (one of: none, detect, block, anonymize).

--content-filter.insults.action.output

string

Output. (one of: none, detect, block, anonymize).

--content-filter.sexual.input-strength

string

Input strength. (one of: low, medium, high).

--content-filter.sexual.output-strength

string

Output strength. (one of: low, medium, high).

--content-filter.sexual.action.input

string

Input. (one of: none, detect, block, anonymize).

--content-filter.sexual.action.output

string

Output. (one of: none, detect, block, anonymize).

--content-filter.violence.input-strength

string

Input strength. (one of: low, medium, high).

--content-filter.violence.output-strength

string

Output strength. (one of: low, medium, high).

--content-filter.violence.action.input

string

Input. (one of: none, detect, block, anonymize).

--content-filter.violence.action.output

string

Output. (one of: none, detect, block, anonymize).

--content-filter.misconduct.input-strength

string

Input strength. (one of: low, medium, high).

--content-filter.misconduct.output-strength

string

Output strength. (one of: low, medium, high).

--content-filter.misconduct.action.input

string

Input. (one of: none, detect, block, anonymize).

--content-filter.misconduct.action.output

string

Output. (one of: none, detect, block, anonymize).

--prompt-attack.strength

string

Strength. (one of: low, medium, high; required in its group).

--prompt-attack.action

string

Action. (one of: none, detect, block, anonymize; required in its group).

--denied-topics.topics

stringArray

Topics. (repeatable; name (bare values comma-split) or protojson object; replaces the full list on update).

--denied-topics.action.input

string

Input. (one of: none, detect, block, anonymize).

--denied-topics.action.output

string

Output. (one of: none, detect, block, anonymize).

--denied-topics.strength

string

Strength. (one of: low, medium, high; required in its group).

--word-filter.managed-profanity

bool

Managed profanity. (true when set; pass --word-filter.managed-profanity=false to disable).

--word-filter.words

strings

Words. (repeatable; replaces the full list on update).

--word-filter.action.input

string

Input. (one of: none, detect, block, anonymize).

--word-filter.action.output

string

Output. (one of: none, detect, block, anonymize).

--word-filter.managed-profanity-languages

strings

Managed profanity languages. (repeatable; replaces the full list on update).

--pii

bool

Pii. (selects this target mode; takes no value).

--pii.entities

stringArray

Entities. (repeatable; protojson object; replaces the full list on update).

--pii.custom-patterns

stringArray

Custom patterns. (repeatable; name (bare values comma-split) or protojson object; replaces the full list on update).

--grounding.grounding-strength

string

Grounding strength. (one of: low, medium, high).

--grounding.relevance-strength

string

Relevance strength. (one of: low, medium, high).

--grounding.action

string

Action. (one of: none, detect, block, anonymize; required in its group).

--text

string

Text. (required).

--direction

string

Direction. (one of: input, output).

--grounding-source

string

Grounding source.

--query

string

Query.

--engine.bedrock

bool

Bedrock. (selects this kind mode; takes no value).

--engine.bedrock.region

string

Region.

--engine.bedrock.static-credentials.access-key-id-ref

string

Access key id ref. (required in its group).

--engine.bedrock.static-credentials.secret-access-key-ref

string

Secret access key ref. (required in its group).

--engine.bedrock.assume-role.role-arn

string

Role arn. (required in its group).

--engine.bedrock.assume-role.session-name

string

Session name.

--engine.redpanda-model-serving

bool

Redpanda model serving. (selects this kind mode; takes no value).

-f, --filename

string

request as YAML or JSON, or - for stdin; flags override file values.

Global flags

Value Type Description

--config

string

Redpanda or rpk config file; default search paths are ~/.config/rpk/rpk.yaml, $PWD/redpanda.yaml, and /etc/redpanda/redpanda.yaml.

-X, --config-opt

stringArray

Override rpk configuration settings; -X help for detail or -X list for terser detail.

--ignore-profile

bool

Ignore rpk.yaml and redpanda.yaml; use default settings.

--profile

string

rpk profile to use.

-v, --verbose

bool

Enable verbose logging.