rpk ai policy create
Create a Cedar authorization policy: the allow/deny gate that decides WHETHER a principal may call a tool.
The Cedar body must contain exactly one statement; scope the resource to your MCP server, for example:
permit(principal, action == Action::"dataplane_adp_mcpserver_tools_call",
resource == McpServer::"servicenow");
Data shaping (masking, dropping, row filtering) is NOT configured here.
It lives on the MCP server’s data policies (rpk ai mcp …), not in Cedar
text; the @redact_mask / @redact_drop annotations are gone.
| This command was introduced in ai version 0.2.26. |
Examples
This section provides examples of how to use rpk ai policy create.
Give a new agent access by binding a seeded template
rpk ai policy create --agent invoice-triage --template sandboxed
Or write the grant in Cedar; its principal must be Agent::"invoice-triage"
rpk ai policy create --agent invoice-triage --cedar-file grant.cedar
Flags
| Value | Type | Description |
|---|---|---|
|
string |
agent id (or agents/<id>) to bind as principal (Agent::"<id>"); defaults |
|
string |
inline Cedar policy text. Mutually exclusive with |
|
string |
path to a file containing the Cedar policy text (.cedar). Mutually exclusive with |
|
string |
human-readable description. |
|
string |
human-readable display name. |
|
string |
policy id (lowercase letters, numbers, hyphens; required unless |
|
string |
policy template to bind: readonly, sandboxed, standard, full (least to most access), or policyTemplates/<id>. Needs |
Global flags
| Value | Type | Description |
|---|---|---|
|
string |
Redpanda or |
|
stringArray |
Override |
|
bool |
Ignore |
|
string |
|
|
bool |
Enable verbose logging. |