Agentic Data Plane

rpk ai policy format

Format a draft using PermissionService, preserving comments. Requires an environment and authentication. Source is limited to 64 KiB of UTF-8. Default output is formatted Cedar on stdout; JSON/YAML/markdown output includes the full result and schema version. Invalid syntax fails without writing formatted source. Schema validation findings in the result do not prevent formatting; use analyze to require valid schema usage. Input files and stored policies are never modified. Redirect to a different file, not the input file.

This command was introduced in ai version 0.2.94.

Usage

rpk ai policy format [flags]

Examples

This section provides examples of how to use rpk ai policy format.

rpk ai policy format --cedar-file draft.cedar > formatted.cedar
cat draft.cedar | rpk ai policy format --cedar-file=-
rpk ai policy format --cedar-file draft.cedar -o json

Flags

Value Type Description

--cedar

string

inline Cedar policy text. Mutually exclusive with --cedar-file.

--cedar-file

string

Cedar input file, or - for stdin. Never overwritten. Mutually exclusive with --cedar.

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.