Skip to content
News

How to Give an AI Agent Access to Only the Projects It Needs

Give an AI agent access to one project, verify what it can read, and decide when it needs to write. A two-project Swarm exercise shows how to check the boundary.

An upward view through a deep circular chamber, with metallic ribs lit by small lights around a dark center.

Give the agent a separate connection scoped to the projects its task requires. Grant read-only access when it only needs to retrieve information, and give it write access only in the project where it needs to save work. Check that the service enforces those limits. Telling an agent which projects to use is a useful instruction, but it cannot make an overbroad connection narrower.

Suppose a customer education team wants an agent to draft a setup guide. The agent needs the product's setup notes, while a separate project holds negotiated customer terms. The person setting up the agent can open both projects. The agent should only be able to open the first. That difference is the point of scoped access.

Decide what the agent can read, write, and share

Start with the job: read the approved setup notes and draft a checklist for new customers. The draft can come back in the current chat, where a person can review it. The agent does not need access to the agreements project, permission to save the draft, or the ability to send it to a customer. If the team later wants the draft saved for ongoing collaboration, grant work access only to the project that should hold it.

This is least privilege for AI agents: limit what the connection can reach and what it can do there. These are separate choices. Read-only access to every project can expose material the job never needed. Work access to one project limits where the agent can act, but still allows supported changes there. Neither choice determines whether an agent can use a different tool to send a message or upload a file.

Review the agent's other routes to the same information. A Space permission governs access through Swarm. It does not alter permissions on the agent's Google Drive connection or change which local files its host can open. For a clean test, use a fresh session with only the intended Swarm connection and no overlapping source connectors, broader credentials, or previously pasted copies of the notes.

Golden oil runs along a narrow metal channel between two pieces of pale stone.

Set up a two-project check in Swarm

Use fictional information so you can verify the boundary without putting real customer data in the test. Create two private Swarm Spaces you can open yourself:

  • Onboarding Guide: Add a note called Setup order. Write that the account owner invites an administrator before importing sample data. This gives you a fact the agent should be able to retrieve and cite.

  • Commercial Terms: Add a note called Pilot terms with a different made-up detail. Do not copy its contents into the first Space or give them to the agent. The team member setting up the test should know the note exists; the agent does not need its contents to verify the boundary.

In Swarm Connect, use the normal approval flow for a compatible MCP or Universal app. When reviewing access, choose Onboarding Guide only and select Read only. Leave Space creation and broader access choices off. Review the selected Spaces and permission level on the consent screen before granting the connection. Any reusable credentials belong in the app's private settings, never in the chat.

CheckExpected result
Ask the agent to list the Spaces this Swarm connection can access.Onboarding Guide appears. Commercial Terms does not.
Ask for the setup order and its source.The agent retrieves the note from Onboarding Guide and identifies the source.
Ask whether the named Commercial Terms Space is available through that connection.The agent cannot retrieve material from it and reports that limitation.
Confirm the approved permissions in Connect.The grant is read-only for Onboarding Guide. No write test or changes to the sample Space are needed.

Look at the app's result from the Space lookup or source read when the host exposes its tool activity. A correct answer does not establish that the agent performed a fresh read, and an answer saying "I cannot access that" does not establish that the service enforced a restriction. An authorized read from one Space paired with the limited listing gives you a useful first check. If the results disagree with the consent screen, stop the test and check which connection the host actually used before changing any permissions.

Open wooden screens separate a sheltered interior from a planted courtyard during rain.

Add work access when the result needs a home

When the agent only needs to propose an answer, the chat response is enough. For a team that wants to keep the checklist with its source material, Read and work on Onboarding Guide can let a compatible agent save a draft there. Review the revised grant or reconnect with that narrower purpose if the host requires it. Keep Commercial Terms excluded and verify the selection again. Work access allows supported changes in the selected Space, so grant it to an agent whose job warrants that access.

Keep publishing a separate decision. A checklist saved for internal review does not authorize a customer email or a change to public documentation. When the job includes a consequential action, decide who can approve it and check the exact draft and destination, as described in the AI agent approval workflow guide.

Sometimes an agent needs one fact from a second project, such as whether a setup step is included in the pilot. A person who can see the original terms can approve a short, shareable note for Onboarding Guide. A source reference in Swarm does not grant access to the referenced material, but any text you copy into a destination becomes part of that destination's content. Check who can see it before sharing.

Sea foam moves around smooth, dark reddish stones along a rocky shore.

Revoke the connection and check for a fresh read

When the work ends, open Connect, identify the app connection you approved, and revoke it. To check the change in your test, add a new fictional note to Onboarding Guide yourself. Ask the host to fetch that note by title through the same connection, without reconnecting or using a different source. It should no longer be able to make the authenticated read. If the host instead asks you to sign in again, leave that request unapproved.

Revocation stops future access through that grant. It does not take back content already returned to the agent, delete chat history, or undo work already submitted. If there is a running job or information has been copied elsewhere, address that separately. The Swarm security guide covers how to manage and revoke connections.

Start with one project and a real task small enough to check yourself. Verify that the agent can read what it needs, leave everything else out of scope, and revisit the grant when the task changes.

Swarm | How to limit AI agent access to specific projects