Agentic Data Plane

Use the Agentic Data Plane CLI

The Redpanda Agentic Data Plane command-line interface, rpk ai, manages Agentic Data Plane resources from your terminal. It drives the same control surface as the Agentic Data Plane UI: large language model (LLM) providers, Model Context Protocol (MCP) servers, OAuth providers and clients, agents, the triggers that invoke them, and the secrets they reference. Because every action is a command, you can script it and run it in continuous integration.

The Agentic Data Plane CLI, also called the Redpanda AI CLI, runs as an rpk plugin, so you install and run it through your existing rpk setup.

After reading this page, you will be able to:

  • Install the Agentic Data Plane CLI and connect it to an AI Gateway

  • Manage Agentic Data Plane resources from the terminal: LLM providers, MCP servers, OAuth providers and clients, agents, triggers, secrets, API keys, budgets, guardrails, and access policies

  • Format command output for scripts and pipelines

rpk ai workflow. Install the rpk ai plugin, sign in and select an Agentic Data Plane environment, then manage LLM providers, MCP servers, OAuth resources, and agents; list or call MCP tools and send A2A messages; or launch supported coding agents through AI Gateway. These workflows share the selected identity and environment.
Figure 1. rpk ai reuses one authenticated environment across resource, protocol, and agent workflows

Install the CLI

The Agentic Data Plane CLI is an rpk managed plugin. Install rpk first (see Install or Update rpk), then install the plugin:

rpk ai install

Update the plugin later with rpk ai upgrade, and remove it with rpk ai uninstall.

Upgrading rpk does not upgrade the plugin. The plugin is a separate binary that stays at its installed version, even across rpk upgrades, until you run rpk ai upgrade. New commands and flags in the reference marked "introduced in ai version X" require the plugin at that version or later.

The CLI tells you when a newer version is published. While a command runs, it checks in the background for a new version, no more than once a day, and prints a notice on stderr naming that version and the command that upgrades it. The notice also appears after a command that fails with an error or prints help, because an outdated CLI often explains those results.

The check never delays a command. A check still running when the command ends is canceled and tried again an hour later. It runs only when both standard output and standard error are terminals, so scripts, pipes, -o json captures, and agents never see the notice, and it is skipped in continuous integration. It never suggests an older version. To turn it off, set RPAI_NO_UPDATE_CHECK=1.

Connect to an AI Gateway

The rpk ai command is self-contained: it has its own login and its own environment selection, independent of any rpk cloud session. You sign in once, choose an Agentic Data Plane environment, and rpk ai targets that environment’s AI Gateway for every command.

  1. Sign in to Agentic Data Plane. This runs an OAuth device-authorization flow in your browser, caches credentials in ~/.rpai/credentials (readable only by you), then lists the Agentic Data Plane environments in your organization so you can pick one:

    rpk ai auth login

    If the browser opens the wrong sign-in provider, or your email address belongs to more than one Redpanda Cloud organization, pass --email <address> so rpk ai looks up your sign-in provider before the browser opens, or --connection <name> to name the Auth0 connection directly. Both flags require the plugin at version 0.2.90 or later. If the browser keeps reusing an earlier session, add --no-browser and open the printed URL in a private window.

    After a plugin upgrade, rpk ai env list reports that no environments are configured until you run rpk ai auth login again. This is expected, because the login rewrites the config.

  2. List the environments available to you, and switch the active one by name or ID:

    rpk ai env list
    rpk ai env use <environment>

    In these commands, <environment> is the name or ID of an Agentic Data Plane environment. rpk ai env use switches the active environment, pointing the CLI at that environment’s AI Gateway. Inspect the resolved environment and token state at any time with rpk ai env show and rpk ai auth status.

  3. Verify the connection:

    rpk ai llm-provider list

For the full setup walkthrough, including token expiry behavior and the supported environment variables, see Use rpk ai for local development.

To target a different AI Gateway URL for a single command without switching environments, pass --rpai-endpoint:

rpk ai --rpai-endpoint https://aigw.<cluster-id>.clusters.rdpa.co llm-provider list

This overrides the selected environment’s AI Gateway URL for that one command; the flag is not bound to an environment variable. For a local or manual gateway you use repeatedly, define it once as an environment with rpk ai env add:

rpk ai env add local --ai-gateway-url http://localhost:8090 --auth-mode none
rpk ai env use local

Get a resource’s commands from the UI

If you would rather not look a command up, Agentic Data Plane can hand you the one you need. Most resource pages carry a Use with rpk ai button in the page header. It opens a panel that walks you through installing the CLI for your operating system, signing in, and selecting the environment you are looking at, then prints a ready-to-run command for the resource in front of you.

The last step has a goal selector. Pick what you want to do, such as listing the resource, inspecting it, or starting and stopping it, and the panel shows the command for that goal with the resource’s own name already filled in. Related commands appear in the same list as a --help invocation, so you can read their flags before you run them. Each setup step remembers whether you collapsed it, so you can fold away the steps you’ve finished and a later visit opens with them still folded.

Manage resources

Each Agentic Data Plane resource has its own command group, and each group supports the standard create, get, list, update, and delete actions. The model catalog and the audit log are read-only.

Command Manages

LLM providers (OpenAI, Anthropic, Google Gemini API, Amazon Bedrock, Gemini Enterprise Agent Platform, and OpenAI-compatible endpoints)

MCP servers and their tools

OAuth providers for user-delegated MCP connections

OAuth clients that external tools use to reach an MCP server

Agents in the agent registry

Agent triggers, which invoke an agent from Microsoft Teams or on a schedule

Kill switch policies that contain an agent automatically

An agent’s containment state: check it, contain the agent manually, or release it

Access policies that decide who can do what

Secrets that LLM providers, MCP servers, OAuth clients, and agents reference by ID

rpk ai api-key

API keys that clients send to AI Gateway instead of a token

rpk ai budget

Budgets that cap what agents, providers, and shared pools can spend

rpk ai guardrail

Guardrails that screen prompts and responses

The model catalog (read-only discovery)

Authorization events in the audit log (read-only)

For example, to create and inspect an LLM provider:

rpk ai llm-provider create openai \
  --openai-config.api-key-ref OPENAI_API_KEY \
  --provider-models gpt-4o \
  --enabled
rpk ai llm-provider get openai

The positional argument (openai here) is the provider’s name. Pass --enabled, because a provider created without it is disabled and rejects every request. Pass at least one --provider-models value, because a provider needs at least one model. The provider type comes from which configuration flag group you use: --openai-config., --anthropic-config., --google-config., --bedrock-config., or --openai-compatible-config.*. Setting flags from two groups is an error. The --openai-config.api-key-ref flag names a secret already stored in Agentic Data Plane. The CLI never takes a raw API key, so secrets stay out of your shell history and out of any file you commit.

Trigger commands take two different arguments, because a trigger belongs to an agent. The create and list commands take the parent agent, and get, update, delete, and runs take the trigger’s full resource name, agents/<agent-id>/triggers/<trigger-id>, which list prints:

rpk ai trigger list support-router
rpk ai trigger update agents/support-router/triggers/daily-digest --enabled=false

The runs command lists a schedule trigger’s recorded runs, newest first. For what triggers do and how to configure them, see Trigger Agents.

Secret commands never print a stored value, and they take the secret’s bare ID or its secrets/<secret-id> resource name. Pass a new value with --value-file, which reads a file, or with --value-file=-, which reads standard input. Either way, the credential stays out of your shell history and out of the process list. Write it with the =, because rpk ai drops a bare - after a flag and --value-file - fails.

For example:

printf %s "$OPENAI_API_KEY" | rpk ai secret create OPENAI_API_KEY --value-file=-
rpk ai secret update OPENAI_API_KEY --tag team=platform
rpk ai secret list --tag team=platform

An update that passes no value keeps the stored one, and --tag merges onto the tags the secret already has rather than replacing them. Use --remove-tag to drop one. For the full CLI workflow, see Manage secrets with rpk ai. That page also covers what secrets are and who can manage them.

To create, update, and delete resources declaratively from YAML manifests instead of imperative flags, see Manage Resources with GitOps.

Inspect an MCP server

Besides managing an MCP server’s configuration, rpk ai mcp-server connects to a server and inspects what it serves at runtime, the same surface the Inspector shows in the UI. Use it to check a server from a script or a terminal, without opening the UI.

rpk ai mcp-server ping handbook
rpk ai mcp-server tools list handbook
rpk ai mcp-server resources list handbook
rpk ai mcp-server resources read handbook 'handbook://oncall'
rpk ai mcp-server resource-templates list handbook
rpk ai mcp-server prompts list handbook
rpk ai mcp-server prompts get handbook summarize --args '{"topic":"oncall"}'

In these commands, handbook is the MCP server’s name. ping reports the MCP protocol version the two sides negotiated and the capabilities the server advertises. Start with it when a server isn’t behaving. A server that answers ping is reachable and authenticated.

A server serves only what it advertises, so a command for a capability the server doesn’t offer fails saying so rather than returning an empty list. Reading a resource goes through the MCP server, which returns the resource’s text or its base64-encoded binary contents along with the response metadata. The CLI never fetches the URI itself. Getting a prompt resolves it and prints its messages, without sending them to a model. The --args value is a JSON object whose values are all strings.

The ping, resources, resource-templates, and prompts commands print JSON, or YAML with -o yaml. The tools list command prints a table unless you pass -o json or -o yaml. The list commands return one page at a time. Read nextCursor from the JSON or YAML output and pass it to --cursor to get the next page. Each command accepts --timeout, which covers the connection and the request together and defaults to 30 seconds.

Query traces, spending, and the agent network

Three read-only command groups return the same data the observability and cost pages show, so you can pull it into a script, a dashboard, or a report.

Command Returns

rpk ai trace

Agent runs and AI Gateway calls, with list, get, and span. See Trace an Agent Run.

rpk ai spending

Cost and usage, with summary, breakdown, time-series, time-series-by-dimension, and tag-keys. See Analyze Cost and Usage.

rpk ai agent-network

Agent relationships, with get, node, and provider-failures. See Visualize Your Agent Network.

The rpk ai trace commands take one flag for each field you filter on. Every listing covers a time range, so --since is required. Give it a timestamp, or a duration ago such as 24h or 7d. Add --until to end the range earlier than now. The range can span at most 30 days. Narrow the list further with --status, --errors, --agent, --user, or --conversation. You can repeat --status and --user to match any of several values, but you can’t combine --status with --errors. Pass a raw filter expression with --filter to narrow the list beyond the other flags. It can’t repeat a field that another flag already sets, so --agent support --filter 'agent_uid = "…​"' fails instead of narrowing the list. --limit caps how many traces are printed, 50 by default and 1,000 at most, and the command reads as many pages as it needs to fill it.

rpk ai trace list --since 24h --errors
rpk ai trace list --since 7d --agent support --order-by "duration desc" --limit 10
rpk ai trace get <trace-id>
rpk ai trace span list <trace-id>

Pass rpk ai trace get the trace ID that rpk ai trace list prints, or a link to the trace copied from the Agentic Data Plane UI, which also tells the command where in time to look. Run rpk ai trace span list to print a trace’s spans, and add --ids for the span IDs that rpk ai trace span get takes. To make a script fail on a run that didn’t finish cleanly, pass --fail-on-error to rpk ai trace get. It exits with code 4 when the trace ended in error or stayed incomplete.

The rpk ai spending and rpk ai agent-network commands instead take their request fields as dotted flags, or a whole request from a file with -f. A time range is two flags:

rpk ai spending summary \
  --filter.start-time 2026-10-01T00:00:00Z \
  --filter.end-time 2026-10-20T00:00:00Z -o json

In -o json and -o yaml, these two groups print the whole response, pagination token included, rather than only the rows. Pass that token back with --page-token to read the next page.

Read the documentation from the terminal

Run rpk ai docs to read the published Agentic Data Plane documentation without leaving your terminal. The command needs no sign-in and no selected environment, because it reads the public documentation site.

rpk ai docs
rpk ai docs cli
rpk ai docs search "oauth"

With no path, the command opens a searchable picker in an interactive terminal, and prints an index when its output is piped. A path is the page’s path on the documentation site, such as cli or connect/coding-agents, and a full documentation URL works too.

The search subcommand matches page titles, paths, and descriptions, not page bodies. It returns up to 20 results by default. Use --limit to change that, up to 100.

These flags change what the command does with a page:

Flag Effect

--web

Open the page in your browser instead of reading it.

--url

Print the page’s URL instead of showing the page. Printing a URL needs no network.

--no-pager

Write to the terminal without a pager.

--non-interactive

Print plain Markdown, with no picker and no pager. Use it in scripts.

--refresh

Require a fresh response instead of falling back to cached content.

Responses are cached for an hour. If a request fails temporarily, the command prints the cached copy with a warning, and marks it as stale in -o json and -o yaml output. The documentation it reads tracks the published site rather than your installed CLI version, so check --help for the flags your installation supports.

Format command output

Every list and get command honors -o (--format):

Format Use

table

Default. Human-readable columns.

wide

Table with extra columns.

json

Machine-readable JSON for scripts and jq.

yaml

YAML. A get -o yaml dump is a complete manifest you can edit and reapply.

markdown

Pipe-friendly tables for documents.

Set a default for the session with the RPAI_FORMAT environment variable. The -o flag always wins when both are set.

Check exit codes in scripts

A script or continuous integration job can tell why a command failed from its exit code:

Code Meaning

0

The command succeeded. An A2A task that is waiting for more input also exits 0.

1

Any other failure, such as a usage error, an unreachable gateway, or a rejected request.

3

Not authenticated or not authorized. Either your credentials are missing or expired, or your account lacks a permission the command needs. Run rpk ai auth login and retry.

4

An A2A task ended in a failed, canceled, or rejected state. The call itself worked, so this is the task’s own outcome rather than a transport error.

Separating exit 3 from exit 1 lets a scheduled job re-authenticate instead of treating an expired token as a broken command. Re-authenticate once on exit 3. If the command exits 3 again after a fresh login, the cause is a missing permission rather than an expired token, so grant the permission the operation needs. See Roles and Permissions Reference.

Trace requests with verbose output

Pass --rpai-verbose (or -v) to log one line per HTTP request to stderr, with the method, URL, response status, and latency:

rpk ai --rpai-verbose llm-provider list

Use it to find out which endpoint a command called and how long the call took. Request and response bodies, headers, and your bearer token never appear in the output, so verbose output is safe to paste into a support ticket. Set the RPAI_VERBOSE environment variable to turn it on for every command in the session.