An AI assistant’s token can have more reach than its user
A software company equips an AI assistant to summarise issue tickets and suggest code changes. The assistant connects to a ticket platform, source repository and build service through application credentials. Staff see a conversational interface that appears to be a low-risk productivity tool. Yet its service tokens may permit searching confidential tickets, commenting on security issues or opening pull requests across projects the asking employee cannot access directly.
That design creates a privilege boundary problem. The model’s natural-language output is not an access-control decision, and a user asking a question is not automatically authorised to exercise every permission held by the assistant. Tokens must be treated as privileged non-human identities with owners, scope, monitoring and revocation paths. The central question is what an external instruction or mistaken model response can cause those identities to do.
Map the authority behind each tool call
Inventory the assistant’s integrations one at a time. Record the token issuer, tenant, environment, granted operations, accessible repositories or queues, expiry, rotation method, storage location and business owner. Include temporary credentials used by background agents and workflows, not just the token entered when the integration was configured. A development bot may obtain additional short-lived credentials from an automation service, extending the effective authority beyond the original token.
Test what the assistant can do without relying on its description of its own limits. An integration described as read-only may be able to trigger a workflow whose side effects create a branch, comment publicly or export attachments. Examine downstream permission grants. For an issue-tracker search, decide whether results must be limited to the requesting user’s access, a fixed service dataset, or a separately authorised investigation role. Each model has different operating and audit implications.
Avoid putting all integrations under one organisation-wide service account for convenience. A single credential spanning ticketing, repositories and deployment pipelines magnifies the consequences of compromise or prompt manipulation. Separate identities by tool and function so the assistant can read an approved support queue without inheriting the authority to change production releases.
Treat retrieved content as data, not instruction
A ticket description, repository README or retrieved document may contain hostile text telling an AI assistant to ignore its operating rules, send information elsewhere or execute a new tool call. The fact that the text arrived through an approved retrieval tool does not make it a trusted instruction. The application should establish which instructions are authoritative and enforce sensitive operations outside the model’s text-generation process.
Consider a hypothetical issue ticket containing a request to paste a repository secret into a comment. The assistant should treat the content as an untrusted artefact, avoid exposing secrets and refuse any tool action not authorised for the user’s task. Controls should include tool-level permissions, allowlisted operations, output filtering where appropriate and explicit approval for consequential actions. A prompt telling the model ‘never reveal secrets’ is not a reliable substitute for preventing the token from reading secrets in the first place.
Test cross-project leakage. A user who can view a public roadmap asks for a summary and receives details from a restricted security incident ticket. The issue is not solved by better wording in the response; the retrieval layer must apply correct object-level authority. Record the search query, effective identity, returned object IDs and decision that allowed each result, without storing unnecessary confidential content in generic logs.
Make tool actions attributable to people and services
Every consequential action should be traceable to the human request, assistant version, tool connector, effective credential and target object. A repository change should show whether the assistant suggested a patch, opened a pull request or merged code; those are materially different privileges. Human review of a pull request is useful only when branch protections and approver independence are technically enforced.
Use a correlation identifier across conversation, decision, tool request and downstream audit event. Protect conversation logs according to their sensitivity: they may reveal customer data, source fragments or private requests. Avoid recording raw access tokens or sensitive retrieved documents in telemetry. An audit trail should let investigators establish what happened without creating a second repository of credentials.
If an agent can work unattended, specify the maximum runtime, work queue, environment and permitted side effects. An apparently short-lived chatbot can become a persistent privileged worker through scheduled jobs and retained credentials. Revoke the unattended path when the project, employee or supplier relationship ends.
Test negative permissions before production
Build test identities with deliberately different access. One user can see a public ticket; another can see an internal incident queue; a third has a narrow development role. Run the same prompt and attempt the same tool action under each identity. Verify that retrieved objects and permitted operations differ as intended. Then insert hostile text into a synthetic ticket and check that it cannot induce an unauthorised export or repository mutation.
Test expired tokens, removed user access and changed repository permissions. The assistant should not continue to act through cached broad credentials after an employee loses authorisation. Where permission changes are eventually consistent, document the delay and limit the assistant’s ability to make high-impact changes during that window.
Exercise a suspected token leak. Security staff should be able to identify affected connectors, revoke credentials, locate recent actions, reissue the narrowest necessary permissions and validate that the compromised token is no longer accepted. A documented rotation feature is weak assurance if using it unexpectedly breaks every agent and no one has rehearsed the recovery sequence.
Assign ownership across engineering, security and product
The product owner determines acceptable use and which actions require human confirmation. Engineering implements tool routing, identity propagation and transaction safeguards. Security reviews privilege boundaries, key storage and abuse signals. The data owner determines whether particular ticket or repository content may be returned to a user. No single team can make all of these decisions by updating an assistant prompt.
Create a change gate for new connectors and newly enabled actions. A summarisation assistant may later gain write access to issue tickets or build jobs as its usefulness grows. Each permission increase requires a revised test matrix, named approver and rollback path. Measure effective authority at the connector API, not just the features exposed in the chat interface.
Design for a confused-deputy failure
A confused deputy acts with its own authority on behalf of a party that lacks that authority. An assistant can become one when it receives a plausible user request but calls a broad service token to retrieve or modify information outside that user’s rights. Test this directly: give an ordinary employee a prompt requesting a summary across projects, including one private security repository. Even if the model refuses to quote sensitive passages, the data should not have been retrieved unnecessarily.
The preferred defence is to constrain object selection and tool permissions before content reaches the model. Where delegated user identity is supported, preserve it through the connector. Where it is not, scope the service account to an intentionally small dataset and require a separately approved path for sensitive actions. Log denied calls without disclosing the protected content in the conversation.
The acceptance test is controlled capability
Before launch, the organisation should be able to demonstrate that a user cannot retrieve unauthorised tickets, that untrusted ticket content cannot trigger protected tool calls, that source changes follow the required approvals, and that revoked service tokens no longer work. Keep results for both allowed and denied cases, along with the credential scopes tested and the limitations of the environment.
AI service tokens are a new operational route for a familiar problem: privileged software acting on behalf of people. Treating them as first-class identities makes useful automation possible without assuming that a fluent model can determine its own authority. This example is hypothetical and should not be read as a report of a real breach.
Sources and further reading
How Next Defence can help
Treat AI service tokens as privileged identities in a scoped AI security and governance assessment. Confirm who can create tools, retrieve sensitive material and revoke delegated authority, with a separate approval for live automation.