Security advisory / awareness
Audit an AI agent’s permissions before connecting accounts or data
Security notice
Direct answer
Do not connect an AI agent to an account or dataset until you can name the identity it will use, the data it can reach, the actions it can take, how long access persists, where actions are logged and how access is revoked.
Start with a test account or non-sensitive data, grant read-only access to the smallest useful scope, require confirmation for external or destructive actions, and prove that revocation works before widening access.
Permission review reduces avoidable exposure but cannot eliminate prompt injection, provider failures, hidden implementation defects or misuse of data already copied elsewhere.
Who this applies to — and the limitation
This guide is for an intelligent beginner connecting a hosted AI agent, assistant, automation or app to personal or workplace email, files, calendars, browsers, code, databases or business services.
It is a pre-connection audit, not a penetration test, legal review, privacy impact assessment or proof that the agent is safe for regulated or high-impact work.
Mental model and essential terms
Account access is the ability to use a person's or organisation's service identity and its authorised resources.
OAuth is a consent-based method that lets an app receive limited access without receiving the user's account password, while a scope is a named permission requested during that process.
An API key or token is a credential presented by software to a service, and anyone who obtains an over-powered key may be able to use the same permitted operations.
A workspace role is a bundle of permissions assigned within an organisation, while delegated permission acts for a signed-in user and application permission can operate without that user present.
Read permission retrieves data; write permission creates or changes data; destructive permission deletes or irreversibly alters it; action permission sends, publishes, purchases or triggers an external effect.
The control chain is identity to credential to permission to data or action to log to revocation, and a gap at any link makes the connection harder to govern.
Build the permission inventory before connecting
- Write down the agent, provider, publisher, connected account, account owner and business owner for the connection.
- List every requested OAuth scope, API key restriction, workspace role, folder, mailbox, calendar, repository, database and browser capability.
- For each permission, record whether it can read, copy, create, edit, send, delete, purchase, administer, run in the background or grant access to somebody else.
- Record whose data is included, whether sensitive or regulated data is present, and whether the scope reaches one item, one account, a shared workspace or the whole organisation.
- Record the consent duration, background access, memory or sync behaviour, provider retention, training setting, third-party terms and deletion route.
- Record the log location, retention period, event detail, alert owner and person authorised to revoke the connection.
Read the consent screen as a contract
- Confirm the app's exact publisher and domain before reviewing its permissions, and stop if the publisher is unknown, inconsistent or unverifiable.
- Translate each scope into a plain-language sentence such as 'read every file in this drive' or 'create and delete calendar events'.
- Reject a broader overlapping scope when a documented narrower scope can complete the task.
- Treat administrator consent, tenant-wide application permission and a role that can manage users, credentials or security settings as a stop-and-escalate condition.
Do not infer that a familiar sign-in provider has approved the agent's later actions, retention practices or downstream data sharing.
Audit API keys and workspace roles
Create a dedicated credential for the agent instead of pasting an owner, administrator or production-wide key into its setup form.
- Restrict the credential to the required service, project, operations, network or environment, set the shortest practical expiry, and store it in an approved secret store rather than in source code, chat or email.
- If a key is exposed or entered into an untrusted agent, create a replacement, update the authorised integration, verify it, and delete the old key.
For workspace roles, prefer a reader or purpose-built role over an owner or administrator role, and scope the role to the smallest resource and period the task needs.
A user's own access ceiling does not make every delegated action safe, because the agent can still act quickly, repeatedly or on misleading input within that ceiling.
Separate data access from actions
For a file-summary trial, grant one test folder read access rather than an entire drive and do not grant write or delete access.
For a calendar assistant, separate reading availability from creating events, inviting external people, changing existing events and deleting them.
For email, treat search and read, draft creation, sending, deletion and mailbox-rule changes as different risk levels even if a product groups them together.
Require a human confirmation immediately before sending, publishing, purchasing, deleting, changing access, executing code or moving money.
- Stop if the product cannot distinguish the requested low-risk action from a broader destructive or externally visible permission.
Check retention, training, memory and downstream use
- Read the policy for the exact plan and connection type because consumer, business, enterprise, API, sync and third-party app data can follow different rules.
- Record whether connected data is indexed or copied, whether it can enter conversation history or memory, how long each copy remains, whether it may train models, and which party answers a deletion request.
Disconnecting access stops future retrieval in many systems but may not delete data the third party already copied, so verify both revocation and deletion separately.
- Do not connect regulated, confidential, client or employee data until the responsible privacy, security and legal owners approve the exact data flow and terms.
Run a reversible trial
- Create a test account or a folder containing invented, non-sensitive records that resemble the format but not the substance of real data.
- Capture the permission inventory and a baseline of existing files, settings and logs before the connection.
- Connect with the narrowest read-only configuration and run one benign task whose expected inputs and outputs are known.
- Inspect the agent history, provider logs and target-system changes for access or actions beyond the test plan.
- Revoke the connection in both the agent and the account provider, then repeat the task and confirm that access fails.
- If the trial used an API key, rotate or delete it after the revocation test when the key was exposed beyond its intended secret boundary.
Widen one permission at a time only when the previous scope is insufficient and the new action has an owner, log and rollback.
Revoke, recover and know when to stop
- To revoke an OAuth connection, disconnect it in the agent, remove its access in the account provider, remove workspace role assignments, and review permission and sign-in logs for activity after the intended stop time.
- To revoke a credential, disable or delete the key or token at its issuer, replace it anywhere legitimate use must continue, and verify that the retired credential fails.
- Ask the provider to delete copied data when the applicable policy says disconnection alone does not remove it.
- Stop before connection when scopes are unknown, the publisher cannot be verified, administrator access is required, logs or revocation are unavailable, or the agent can make financial, destructive or externally visible changes without a separate approval.
- Escalate to the organisation's security, privacy, legal or system owner before using sensitive regulated data, production credentials, tenant-wide application permission or automated financial actions.
Original asset and limitations
The publication package requires a downloadable permission-audit worksheet with identity, scope, data, action, persistence, log, revocation, owner and decision columns plus a red-amber-green stop matrix.
Red means do not connect without specialist approval, amber means trial with added controls, and green means a narrow reversible trial rather than a declaration of safety.
Before publication, a targeted security reviewer must check the high-impact stop rules, revocation sequence and worked permission examples against the final products represented in the asset.
Permission names, plan boundaries, retention rules and user interfaces change quickly, so current-source refresh is required at the launch gate and after any material product change.
No agent, account or API connection was created or tested for this article, and no product-specific safety certification or compliance conclusion is made.
Sources
- AI-GITHUB-CREDS — Keeping your API credentials secure — GitHub; retrieved 2026-08-06; market Global.
- AI-GOOGLE-ACCESS — Share some access to your Google Account data with third-party apps — Google; retrieved 2026-08-06; market Global.
- AI-GOOGLE-KEYS — Manage API keys — Google Cloud; retrieved 2026-08-06; market Global.
- AI-GOOGLE-SCOPES — OAuth 2.0 scopes for Google APIs — Google; retrieved 2026-08-06; market Global.
- AI-MS-AGENT-AUTH — Authorization in Microsoft Entra Agent ID — Microsoft; retrieved 2026-08-06; market Global enterprise.
- AI-MS-AUDIT — View activity logs of application permissions — Microsoft; retrieved 2026-08-06; market Global enterprise.
- AI-MS-CONSENT — Consent experience for applications in Microsoft Entra ID — Microsoft; retrieved 2026-08-06; market Global enterprise.
- AI-MS-REVOKE — Review permissions granted to enterprise applications — Microsoft; retrieved 2026-08-06; market Global enterprise.
- AI-OPENAI-APPS — Apps in ChatGPT — OpenAI; retrieved 2026-08-06; market Global subject to plan and regional limits.
- AI-OPENAI-DATA — Data controls in the OpenAI platform — OpenAI; retrieved 2026-08-06; market Global.
- AI-OPENAI-GOOGLE-DATA — Google App for ChatGPT — Data Controls FAQ — OpenAI; retrieved 2026-08-06; market Global subject to workspace controls.
- AI-OWASP-AGENT — AI Agent Security Cheat Sheet — OWASP; retrieved 2026-08-06; market Global.
- General information: Nerd Mango provides general informational content. It is not legal, financial, medical, investment or other professional advice.
- AI assistance: AI tools assisted research and drafting. Every article is edited and approved by a real human editor; AI is never the accountable author and never publishes autonomously.