This article follows the official documentation. We haven’t tested this tool for a hands-on review.
When a coding agent checks whether resources in a local file match a live Redpanda deployment, rpk ai agent diff compares them without changing the deployment. Redpanda is a Kafka-compatible platform for streaming records, and rpk is its command-line tool. The local file is a manifest: it describes resources and their settings.
The command compares the manifest’s declarations with live resources and reports which ones a command that applies the manifest would create, update, or leave unchanged. This helps you spot configuration drift, differences between the manifest and deployment, before anyone changes the deployment. The command appears in Redpanda’s Agentic Data Plane reference, so first check that it is available in your Redpanda environment.
What the diff checks
The rpk agent diff reference says the command previews applying a manifest. It compares fields the command can change, including fields the manifest leaves out. If a field the manifest leaves out has a different live value from the value the command would set when creating the resource, the command reports drift.
The command exits with a nonzero status when any change is pending. A continuous integration (CI) job or coding agent can use that status to flag a deployment that does not match its manifests. The diff does not identify live resources missing from the manifests, so it cannot report resources that should be removed.
Set up access
Check the official rpk reference for installation and configuration instructions for your Redpanda environment. The agent diff command appears in the Agentic Data Plane documentation, but its command page does not say which rpk versions or deployment types include it. Confirm that your environment supports the command before building an agent workflow around it.
The command needs access to the live Redpanda resources it compares. Set up rpk to connect to your deployment and use its credentials, following the instructions for that deployment. Keep the connection details outside the agent prompt. Give the agent access only to the configured environment, and do not paste passwords, tokens, or other secrets into its prompt. The manifest stays on your machine, while the command contacts the live service to compare resources. The diff reports proposed changes without applying them.
Compare a manifest
Use the command with a path to a supported manifest:
rpk ai agent diff <manifest-path>
Replace <manifest-path> with the path to an existing manifest in a format your Redpanda environment supports. The path might point to a file in the repository the agent is editing. The command page describes how the comparison works. Check its current syntax and manifest requirements before relying on a specific file format or additional flags.
The report identifies resources that would be created, updated, or left unchanged. For an update, it names the fields that differ. A coding agent can explain which settings in the manifest do not match the live resources, then stop for review. If the command exits nonzero, at least one change is pending; the command has not applied it.
A useful agent prompt for this task is: “Run rpk ai agent diff against the manifest I changed. Summarize any resources and fields it reports as different. Do not apply changes or modify the manifest.” The agent should report the actual command result rather than infer success from the manifest alone.
Know what the diff misses
The command compares resources listed in the manifests. It does not find extra resources that exist only in the live deployment. So a clean comparison does not prove that the deployment has no unwanted resources. It means only that the documented comparison found no pending changes for the manifest inputs.
Because the command is documented under the Agentic Data Plane reference, check that your deployment supports it before asking an agent to use it. For broader Redpanda command-line tasks, browse the rpk reference.