Build an Access Model for Multiple Teams
When several teams share one Redpanda Agentic Data Plane environment, each team needs to build and release its own agents. This tutorial builds that model with tags and access policies for ACME, an example company whose platform, accounting, and support teams share one environment.
After reading this page, you will be able to:
-
Design a tag scheme that sets team ownership and release stage on agents, MCP servers, and LLM providers
-
Write access policies that let each team build and release its own agents without changing a policy
-
Verify the access model by running allowed and denied requests as each team’s users
Prerequisites
You switch between several users, so set these up first:
-
An identity provider connected to your organization’s single sign-on (SSO), with three groups:
platform,accounting, andsupport. Configure group claim extraction in your SSO connection settings, so that the ID token carries the user’s groups in itsgroupsclaim. -
Test users: one in
platform, one inaccounting, and two insupport, plus a user with the Admin role. See Control Who Can Do What. -
An Agentic Data Plane environment with no agents, MCP servers, or LLM providers in it yet.
-
An OpenAI API key.
-
rpk ai, if you follow the CLI steps. See rpk ai install.
Agentic Data Plane reads a user’s groups when they sign in. If you change someone’s group membership, they get the new access after they sign in again.
What you’ll build
Each ACME team maps to one IdP group:
| Team | IdP group | What it does in Agentic Data Plane |
|---|---|---|
Platform engineering |
|
Owns the environment. Creates the shared LLM provider and writes every access policy. |
Accounting |
|
Builds and releases the |
Support |
|
Builds and releases the |
Every agent and MCP server carries two tags, and the shared LLM provider carries a third:
| Tag | Values | What it records |
|---|---|---|
|
|
Which team owns the resource. Keep values lowercase. A condition compares strings exactly, so |
|
|
Where an agent is in its release lifecycle. |
|
|
Whether every team can use the resource. Only the LLM provider carries it. |
The stage tag decides who can run an agent:
-
dev: Only the person who created the agent. -
uat: The owning team and the platform team. -
prod: Everyone.
Moving an agent to the next stage is a tag change that the owning team makes. No policy changes.
Each policy is a Cedar block whose first line is a comment with the policy’s name. To create one:
-
CLI
-
UI
Save the block to a file named <policy-name>.cedar, then run:
rpk ai policy create --name <policy-name> --cedar-file <policy-name>.cedar
-
Open Access in the sidebar.
-
On the Policies tab, click Create policy.
-
Name the policy.
-
Switch to Cedar and paste the block.
-
Click Create policy.
The UI also has a Form view that builds the same policy from menus. See Create a policy.
Give the platform team full access
Start as the Admin user, because no policy lets anyone else create one yet. The Admin role grants its access as an ordinary permit, so the forbid policies later in this tutorial apply to Admins too.
rpk ai auth login --email admin@acme.example --env <environment>
Create a policy that grants the platform group every action on every resource:
// platform-full-access
permit (
principal in Group::"platform",
action,
resource
);
Only the platform team and Admins can create, change, or delete policies. Whoever can change a policy can change every other policy, so keep that ability narrow in your own model.
Sign out and sign in as the platform user:
rpk ai auth logout
rpk ai auth login --email platform@acme.example --env <environment>
Each login opens a browser sign-in, and you become whoever completes it. --email only selects the sign-in provider, so complete the browser sign-in as the user you’re switching to. Pass --env on every login, because signing out clears the selected environment and a login without it prompts you to choose one. In the UI, sign out and sign back in as that user. Do this each time you change users.
Create the shared LLM provider
The platform team creates the one resource every team depends on.
-
CLI
-
UI
Store the API key as a secret, then create the provider. Pass --enabled, because a provider created without it rejects every request.
printf %s "$OPENAI_API_KEY" | rpk ai secret create OPENAI_API_KEY --value-file=-
rpk ai llm-provider create openai \
--openai-config.api-key-ref OPENAI_API_KEY \
--provider-models gpt-4o \
--enabled \
--tags team=platform \
--tags shared=true
Create an OpenAI provider as described in Configure an LLM Provider, with these values:
-
Display name:
openai. -
Credential: Select Bring a new API key reference, enter
OPENAI_API_KEYas the key name, paste the key, and click Save key. -
Models:
gpt-4o. -
Tags:
team=platformandshared=true. See Provider tags.
Every team needs to see the provider to attach it to an agent, and to call it when they run one:
// all-shared-llm-use
permit (
principal,
action in [Action::"LLMProvider.get", Action::"LLMProvider.list", Action::"LLMProvider.invoke"],
resource is LLMProvider
) when {
resource.hasTag("shared") &&
resource.getTag("shared") == "true"
};
The hasTag check comes first because reading a tag that a resource doesn’t have is an evaluation error, not false. See Guard every tag read.
When someone runs an agent, the agent’s model calls and tool calls are authorized as that person, not as the agent. Without LLMProvider.invoke on the shared provider, nobody can run an agent that uses it.
A scheduled trigger runs as the person who created it, but without their group memberships. A policy that grants a group doesn’t apply to the run, even when the creator belongs to that group. Policies that grant the creator by name, or that apply to every principal, such as all-shared-llm-use, still do. With this tutorial’s policies, a scheduled run of a prod agent gets the model through all-shared-llm-use but is denied its tools, because each team’s tool grant names a group. A scheduled run of a dev or uat agent is denied unless the trigger’s creator also created the agent. In that case the Owner lifecycle policy lets the run start, but its tool calls are still denied. See Run an Agent on a Schedule.
Let each team manage its own resources
Each team gets three policies: one for its agents, one for its MCP servers, and one for calling the tools on its servers. The accounting team’s agent policy:
// accounting-agents
permit (
principal in Group::"accounting",
action in [Action::"Agent.create", Action::"Agent.get", Action::"Agent.list", Action::"Agent.invoke", Action::"Agent.update"],
resource is Agent
) when {
resource.hasTag("team") &&
resource.getTag("team") == "accounting"
};
Its MCP server policy:
// accounting-mcp
permit (
principal in Group::"accounting",
action in [Action::"McpServer.create", Action::"McpServer.get", Action::"McpServer.list", Action::"McpServer.update", Action::"McpServer.initialize", Action::"McpServer.tools_list"],
resource is McpServer
) when {
resource.hasTag("team") &&
resource.getTag("team") == "accounting"
};
Grant tool calls by the same tag. Each tool reads its server’s tags, so this one policy covers the tools on every server the team owns, including servers it adds later:
// accounting-tool-calls
permit (
principal in Group::"accounting",
action == Action::"McpServerTool.call",
resource is McpServerTool
) when {
resource.hasTag("team") &&
resource.getTag("team") == "accounting"
};
Create the same three policies for support, as support-agents, support-mcp, and support-tool-calls, with support in place of accounting. Each new team adds three policies of its own.
Name each policy after the principal it applies to, such as accounting-agents. When a policy applies to everyone, start its name with all-. You can then tell at a glance which team a policy belongs to.
Build each team’s agent
Sign in as the accounting user. Create the erp MCP server and the invoice-triage agent, both tagged team=accounting and stage=dev. The erp URL is a placeholder. Use the URL of an MCP server you can reach.
-
CLI
-
UI
rpk ai agent takes --tag, while rpk ai mcp-server and rpk ai llm-provider take --tags.
rpk ai auth logout
rpk ai auth login --email accounting@acme.example --env <environment>
rpk ai mcp-server create erp \
--enabled \
--remote.url https://erp.acme.example/mcp \
--remote.transport streamable-http \
--tags team=accounting \
--tags stage=dev
rpk ai agent create invoice-triage \
--llm-provider openai \
--model gpt-4o \
--mcp-server erp \
--system-prompt "Triage inbound invoices against purchase orders." \
--tag team=accounting \
--tag stage=dev
rpk ai agent start invoice-triage
-
Create a Remote (Proxied) MCP server named
erpwith the server URLhttps://erp.acme.example/mcp. Select Streamable HTTP as the transport and No Authentication as the authentication method, and add the tagsteam=accountingandstage=dev. Click Create server. See Create an MCP Server. -
Create a Managed by Redpanda agent named
invoice-triagethat uses theopenaiprovider, thegpt-4omodel, and theerpMCP server. Under Advanced, add the tagsteam=accountingandstage=dev. Click Create agent. See Create an Agent. -
On the agent’s Settings tab, under Runtime, click Start agent.
Now try to create an agent for another team:
rpk ai agent create sneaky \
--llm-provider openai \
--model gpt-4o \
--tag team=support \
--tag stage=dev
The request is denied. On a create, a condition is checked against the resource the request would produce, and accounting-agents only matches agents tagged team=accounting. See Conditions on writes evaluate the resulting state.
Sign in as the support user and build the support side the same way, with zendesk as the MCP server and refund-helper as the agent, both tagged team=support and stage=dev:
rpk ai auth logout
rpk ai auth login --email support@acme.example --env <environment>
rpk ai mcp-server create zendesk \
--enabled \
--remote.url https://acme.zendesk.example/mcp \
--remote.transport streamable-http \
--tags team=support \
--tags stage=dev
rpk ai agent create refund-helper \
--llm-provider openai \
--model gpt-4o \
--mcp-server zendesk \
--system-prompt "Draft refund decisions for agent review." \
--tag team=support \
--tag stage=dev
rpk ai agent start refund-helper
Gate agents by release stage
Sign in as the platform user. The team policies let each team use its own agents at every stage. The policies in this section change who else can, based on the stage tag.
Keep dev agents with their creator
A half-built agent shouldn’t answer anyone else’s requests, including the creator’s teammates. This forbid denies running any dev agent, except for the person who created it:
// all-dev-creator-only
forbid (
principal,
action == Action::"Agent.invoke",
resource is Agent
) when {
resource.hasTag("stage") &&
resource.getTag("stage") == "dev"
} unless {
resource has created_by &&
resource.created_by == principal
};
The creator can still run the agent through their team’s policy. The built-in Owner lifecycle policy also lets people run the agents they created.
Let the owning team run UAT agents
UAT needs no policy. The dev forbid no longer applies, so the team’s own policy lets its members run a uat agent. The only other permits that reach it are platform-full-access, the Admin role, and the Owner lifecycle policy for the agent’s creator, so the platform team, Admins, and the creator can run it too. Apart from them, nobody outside the team can run it.
Release prod agents to everyone
// all-prod-invoke
permit (
principal,
action in [Action::"Agent.get", Action::"Agent.list", Action::"Agent.invoke"],
resource is Agent
) when {
resource.hasTag("stage") &&
resource.getTag("stage") == "prod"
};
Agent.get and Agent.list let people find the agent by name. Update isn’t granted, so only the owning team, the agent’s creator, the platform team, and Admins can change a released agent.
Block untagged agents
An agent missing either tag can’t be run by anyone until someone tags it:
// all-untagged-deny
forbid (
principal,
action == Action::"Agent.invoke",
resource is Agent
) unless {
resource.hasTag("stage") &&
resource.hasTag("team")
};
Keep resources inside their team
An update is checked against the resource it would produce. Without another rule, a support user could retag an accounting agent to team=support, and the result would match support-agents. The Owner lifecycle policy would also let a creator retag their own agent into another team. This forbid closes both, for everyone except the platform team:
// all-teams-cannot-change-team-tag
forbid (
principal,
action,
resource
) when {
resource has changed_tags &&
resource.changed_tags.contains("team")
} unless {
principal in Group::"platform"
};
changed_tags is the set of tag keys an update adds, removes, or changes. It exists only on updates, so creates and reads aren’t affected. Because the exemption names the platform team instead of listing the other teams, a team you add later is covered without editing this policy. Admins who aren’t in the platform group can’t change a team tag either.
Changing stage needs no extra policy. A team’s own policy lets it update its agents, including the stage tag, so releasing an agent stays with the owning team.
Release an agent and verify
Move refund-helper through its lifecycle as the support user who created it, and check each stage before you move to the next. Make each request as a user in the group the row names. To run an agent, send it a message with rpk ai agent a2a send <agent> "<message>", or open it in the Playground. A denied request returns a permission-denied error. A denied run returns 403 Forbidden with a message that starts ADP authorization denied: and names the user, the action, and the agent. The message doesn’t name a policy, and it reads the same whether a forbid blocked the run or no permit allowed it. rpk ai agent a2a send doesn’t print the message and reports only unexpected HTTP status: 403 Forbidden.
The gateway caches each agent for up to 30 seconds, so wait 30 seconds after each tag change before you test it.
Check the dev stage
refund-helper is in dev from when you created it:
| As | Request | Result | Why |
|---|---|---|---|
The support user who created |
Run |
Allowed |
|
Another support user |
Run |
Denied |
|
An accounting user |
Run |
Denied |
No |
Move to UAT and check
--tag on rpk ai agent update replaces the whole tag set, so repeat the team tag. Repeating it doesn’t trip all-teams-cannot-change-team-tag, because that policy reacts only to a tag whose value changes:
rpk ai auth logout
rpk ai auth login --email support@acme.example --env <environment>
rpk ai agent update refund-helper --tag team=support --tag stage=uat
In the UI, open the agent’s Settings tab, change the stage tag, and click Save changes.
| As | Request | Result | Why |
|---|---|---|---|
Another support user |
Run |
Allowed |
|
An accounting user |
Run |
Denied |
No |
An accounting user |
Change |
Denied |
No |
Release to prod and check
rpk ai agent update refund-helper --tag team=support --tag stage=prod
| As | Request | Result | Why |
|---|---|---|---|
An accounting user |
Run |
Allowed, but its |
|
An accounting user |
Update |
Denied |
|
A support user |
Change |
Denied |
|
The support user who created |
Change |
Denied |
|
An accounting user |
Update the |
Denied |
|
Check an untagged agent
As the accounting user, create and start an agent tagged only team=accounting. accounting-agents permits the create, because the agent carries the team tag:
rpk ai auth logout
rpk ai auth login --email accounting@acme.example --env <environment>
rpk ai agent create untagged-test \
--llm-provider openai \
--model gpt-4o \
--tag team=accounting
rpk ai agent start untagged-test
| As | Request | Result | Why |
|---|---|---|---|
The accounting user who created |
Run |
Denied |
|
If a result doesn’t match these tables, check the system-managed policies too. Agentic Data Plane seeds them, such as the Owner lifecycle policy, and they take part in the same evaluation. See A request is denied.
Let other teams use a released agent’s tools
When someone runs an agent, the agent connects to its MCP servers and lists their tools under the built-in Agent MCP tool discovery policy, but each tool call runs as the person. That’s why an accounting user who runs refund-helper gets a reply without its zendesk tool results.
This tutorial’s MCP servers need no authentication. A server that uses user-delegated OAuth connects and lists tools as the person instead, so a team that runs another team’s agent on such a server also needs McpServer.initialize and McpServer.tools_list on it.
Access across team boundaries is the platform team’s decision. Grant it per server. A tag condition here would have to match team=support, which would give accounting the tools on every support server, including servers support adds later. As the platform user, grant accounting the tools on zendesk only:
// accounting-zendesk-tool-calls
permit (
principal in Group::"accounting",
action == Action::"McpServerTool.call",
resource is McpServerTool in McpServer::"zendesk"
);
Run refund-helper again as the accounting user. Its zendesk tool calls now succeed.
This grant covers tool calls only. Accounting still can’t connect its own MCP client to zendesk, because connecting and listing tools need McpServer.initialize and McpServer.tools_list, and only support-mcp grants those.
What you built
| Policy | Effect | Principal | What it covers |
|---|---|---|---|
|
Permit |
|
Every action on every resource. |
|
Permit |
Everyone |
Get, list, and invoke LLM providers tagged |
|
Permit |
|
Create, get, list, invoke, and update agents tagged |
|
Permit |
|
Create, get, list, update, initialize, and list tools on MCP servers tagged |
|
Permit |
|
Call tools on MCP servers tagged |
|
Permit |
|
Create, get, list, invoke, and update agents tagged |
|
Permit |
|
Create, get, list, update, initialize, and list tools on MCP servers tagged |
|
Permit |
|
Call tools on MCP servers tagged |
|
Forbid |
Everyone |
Run agents tagged |
|
Permit |
Everyone |
Get, list, and invoke agents tagged |
|
Forbid |
Everyone |
Run agents missing |
|
Forbid |
Everyone except |
Any update that changes a |
|
Permit |
|
Call tools on |
Adding an agent or an MCP server, or releasing an agent, doesn’t change this set. A new team adds its own three policies, and access across teams adds one policy per server.
Clean up
The forbid policies in this tutorial apply to everyone in the environment, so delete what you created when you’re done. Sign in as the platform user and delete the resources first, while platform-full-access still grants you access:
rpk ai agent delete invoice-triage
rpk ai agent delete refund-helper
rpk ai agent delete untagged-test
rpk ai mcp-server delete erp
rpk ai mcp-server delete zendesk
rpk ai llm-provider delete openai
rpk ai secret delete OPENAI_API_KEY
Then delete the policies, with platform-full-access last:
for p in all-shared-llm-use accounting-agents accounting-mcp accounting-tool-calls \
support-agents support-mcp support-tool-calls all-dev-creator-only all-prod-invoke \
all-untagged-deny all-teams-cannot-change-team-tag accounting-zendesk-tool-calls; do
rpk ai policy delete "$p"
done
rpk ai policy delete platform-full-access
In the UI, delete the same resources and policies in the same order.