Join our Newsletter — 33% off our NHI Course
Home› Guides› Internal AI Agents vs Third-Party Agents: Credential Ownership,…
Guide Agent Governance & Risk

Internal AI Agents vs Third-Party Agents: Credential Ownership, Delegation, Logging and Contract Controls

PDF for newsletter subscribers · free to read online

← All guides
By NHI Mgmt Group, edited by Lalit Choda Updated 14 November 2026 17 min read
On this page

When a vendor's AI agent acts inside your tenant, it uses access you granted but credentials you do not hold, runs logic you cannot inspect and writes logs you may never see. An agent your own team builds can be governed like any other workload: you issue its identity, store its secrets, set its permissions and read its audit trail. A third-party agent, such as a SaaS vendor's sales, support or coding agent connected to your CRM, mailbox or repositories, reverses most of that. This guide compares them on credential ownership, delegation, logging and the gaps only a contract can close. It is for identity architects, third-party risk teams and AI governance owners. Where products are named, platforms are listed alphabetically and only as documented examples.

Key takeaways

  • Credential custody is the dividing line. For an internal agent, its secrets sit in your vault and your identity provider can rotate them; for a third-party agent, refresh tokens and client secrets usually sit in the vendor's environment, so a vendor breach becomes your breach.
  • You control the grant, not the agent. With a vendor agent your levers are consent, scopes, conditional access on its principal in your tenant, and revocation; design every control around those.
  • Delegation must be visible in your logs. If you cannot tell an agent action from the user's own action in your audit trail, you cannot investigate or attribute an incident, whoever built the agent.
  • Logs you cannot obtain do not exist for an investigation. The vendor's record of prompts, reasoning and tool calls is often the only evidence of why an agent acted; negotiate access to it before you need it.
  • Contracts cover what you cannot configure. Token storage, breach notification, revocation support, model and sub-agent changes, and log export are vendor-side behaviours; write them into the agreement and verify the ones you can.

The short answer

Treat an internal agent as a non-human identity you own end to end and govern it with your existing identity, secrets and logging controls. Treat a third-party agent as a supplier holding delegated access to your systems: keep its grant as narrow and as short-lived as the use case allows, make its principal in your tenant subject to the same conditional access and review as your own workloads, and close the remaining gaps (credential storage, vendor-side logs, incident cooperation) by contract. Admit a vendor agent with write access to sensitive systems only when you can revoke it in minutes, attribute its actions in your logs and obtain its own action records on request.

This page sits beside related comparisons. For the identity model an agent runs under, see AI Agent Service Accounts vs On-Behalf-Of Access. For agents your staff build on a vendor's platform, see Custom AI Assistants vs Enterprise Agents and Citizen-Built Agents vs IT-Built Agents. For the general split between clauses and settings with AI providers, see Contractual vs Technical Controls for Third-Party AI.

What counts as internal and what counts as third-party

  • Internal agent: your team writes or configures the agent logic, runs it in infrastructure you control (or a cloud tenancy you own), and holds its credentials.
  • Third-party agent: a vendor operates the agent as part of its service and reaches into your systems through access you grant: an OAuth consent, an app registration or service principal in your directory, an API key you create and hand over, or a connector in your SaaS tenant. The vendor's code decides what to do with that access.
  • Hybrid cases: an agent built by your staff on a vendor's agent platform is internal for logic and ownership but third-party for hosting and logs. If the vendor holds the credentials or can change the agent's behaviour without your approval, apply the third-party controls to that part.

Side-by-side comparison

DimensionInternal agentThird-party agent
Identity issued byYour identity provider or cloud platformVendor's application, represented in your tenant by a principal created on consent
Credential custodyYour secrets manager or workload identity; you rotateVendor's environment; you can revoke the grant but not inspect storage
Permission settingYour role design, reviewed by your ownersScopes the vendor requests; you accept, narrow (if supported) or refuse
Behaviour changesThrough your change processVendor releases, model swaps and prompt changes, often without notice
DelegationYou choose on-behalf-of or own identity per actionFixed by the vendor's integration design; often a long-lived refresh token
Logs you holdFull: prompts, tool calls, decisions, resource accessOnly what your systems record about the principal's API calls
Logs the vendor holdsNonePrompts, reasoning, tool selection, retries, other customers' traffic patterns
Kill switchDisable the identity, stop the workloadRevoke consent or disable the principal; vendor-side caches and queued jobs may persist
Main concentration riskYour own secret sprawlOne vendor environment holding tokens for many customers

Credential ownership

Internal agents

For an agent you run, the goal is no long-lived secret at all. Cloud platforms now issue agent-specific identities. Google Cloud's Agent Identity gives each agent a SPIFFE-based cryptographic identity whose X.509 certificate is provisioned and managed on the agent; Google's documentation states that, unlike service accounts, these identities are not shared by multiple workloads by default and cannot be impersonated, while you still manage the IAM bindings. Microsoft Entra Agent ID represents agents as agent identities created from an agent identity blueprint; credentials are configured on the blueprint, permissions granted to a blueprint are granted to every agent identity created from it, and disabling a blueprint prevents all of its agent identities from authenticating. See the Cloud Agent Identity Services Compared (Entra, AgentCore, Google).

Third-party agents

A vendor agent usually reaches your systems as a multi-tenant application. Microsoft's identity platform documentation describes the pattern clearly: the application object lives only in the vendor's home tenant, and a service principal is created in each customer tenant where consent is granted; that service principal defines what the app can do in your tenant. The vendor holds the application's credentials, and with delegated access it also holds users' refresh tokens. Entra applies the same split to agents: a blueprint can be published as multitenant, customers add it to their tenant, a blueprint principal appears there, and deleting that principal removes the blueprint from the tenant. Microsoft also notes that the permission declarations on a blueprint do not grant anything by themselves; an administrator must still consent.

The practical consequence is that the vendor's environment becomes a store of keys to many tenants. In the Salesloft Drift Breach 2025, OAuth tokens held in the vendor's cloud environment for a chat integration were used to bulk-export Salesforce data from many customer organisations; MFA and SSO did not help because the tokens were already authorised.

  • Prefer grants you can bound: admin consent over user consent, narrow scopes, resource-specific consent where the platform offers it, and short refresh token lifetimes where you control them.
  • Never hand over a personal or admin credential: if a vendor asks for an API key, create a dedicated key for that vendor with the minimum permission, an owner, an expiry and a name that identifies the vendor in logs.
  • Apply conditional access to the vendor's principal: restrict where tokens can be used from, if the platform supports location or network conditions for workload identities.
  • Ask how tokens are stored: encryption, key management, segregation per customer, and how quickly the vendor can revoke all of your tokens on request.

Delegation: whose authority the agent uses

Both kinds of agent act either with their own authority or on behalf of a user. RFC 8693, OAuth 2.0 Token Exchange, gives the vocabulary that matters for governance. With impersonation, the agent is given the user's rights and is indistinguishable from the user within that context. With delegation, the agent keeps its own identity and acts for the user; the issued token carries an act (actor) claim identifying the current actor, nested act claims record prior actors in a chain, and a may_act claim can state in advance who is allowed to act for a subject.

QuestionInternal agentThird-party agent
Can you choose delegation over impersonation?Yes: issue tokens through token exchange with an actor, or use an agent identity paired with on-behalf-of flowsOnly if the vendor's integration supports it; many use the user's own refresh token, which looks like the user
Can you see the agent in the audit trail?Yes, if you design for itOnly as the app or principal identifier; with plain user-token delegation, possibly not at all
Can you bound the chain?Yes: limit nested delegation, attenuate scope at each hopThe vendor may call its own sub-agents or other providers; ask for the chain in writing
Is the token bound to one resource?Yes: request audience-restricted tokensDepends on the vendor; for MCP-based tools the specification requires audience binding

The Model Context Protocol authorisation specification (version 2025-11-25) shows what good looks like for tool access, whoever runs the agent: clients must send the RFC 8707 resource parameter, servers must validate that tokens were issued for them, and servers must not pass through the token they received to upstream APIs. A vendor agent that connects to your MCP servers should meet those requirements; one that asks you for a token it will forward elsewhere does not. See Delegation Chains and Attenuated Authority for AI Agents.

Logging and evidence

For an internal agent you can log the whole decision path: the triggering request, the prompt and retrieved context, each tool call with arguments, the identity and token used, and the outcome. For a third-party agent your own systems see only the last step, an API call by the vendor's principal or by a user token. The reasoning that explains why the call happened lives with the vendor.

  • Your side, both types: record the principal or app identifier, the acting user (if delegated), scopes, source network, resource and operation for every call; alert on volume and new resource types.
  • Vendor side, third-party only: agree in the contract which agent records the vendor keeps (prompts, tool calls, approvals, errors), for how long, in what format, and how quickly you can obtain them during an incident.
  • Join keys: ask the vendor to send a request identifier with each call so records can be matched.
  • Regulated use: where an agent's use falls under sector rules or the EU AI Act, the deployer's own logging and record-keeping duties do not move to the vendor. See the EU AI Act Provider vs Deployer Obligations Guide and Agent Observability vs Audit Logging.

Contract controls specific to agents

Standard AI provider clauses on training use, retention and sub-processors are covered in Contractual vs Technical Controls for Third-Party AI. An agent that acts in your systems needs further terms, because the vendor now holds authority as well as data.

ClauseWhat it should sayHow to verify
Credential storageHow tokens and keys for your tenant are encrypted, segregated and access-controlled; no storage in source repositories or support systemsSecurity questionnaire, assurance report scope, architecture review
Revocation supportThe vendor revokes all tokens for your tenant on request within a stated time and confirms in writingTest once during onboarding by revoking and re-granting
Breach notificationNotice within a stated time of any suspected compromise of your tokens or of the agent's runtime, including suspected prompt injection leading to actionsTabletop exercise with the vendor's contact
Scope and capability changesAdvance notice before the agent requests new scopes, gains new write actions or changes its underlying model or sub-agentsConsent prompts for new scopes; release notes review
Action recordsRetention and export of agent action logs for your tenant; format and turnaroundRequest a sample export during onboarding
Human approvalWhich actions the agent will not take without a customer-side approval, and that the setting cannot be changed by the vendor aloneConfiguration review; test an action that should need approval
ExitDeletion of tokens, caches and derived data at termination, with confirmationCheck the principal is removed and calls stop

See the AI Vendor Security Questionnaire Template.

Threat model for each side

  • Internal agents, main threats: over-privileged identities (an agent given broad standing access because scoping was hard), leaked secrets in code or configuration, prompt injection steering tool use, orphaned agents after the owner leaves. The PocketOS Database Deletion 2026 shows the cost of an agent holding a broad token without an action-level check.
  • Third-party agents, main threats: compromise of the vendor's environment exposing your tokens, prompt injection in content the vendor agent reads from your systems, silent capability changes after a vendor release, user-consented shadow AI apps with broad scopes, and stale grants for tools nobody uses.
  • Shared threat: excessive agency. OWASP LLM06:2025 names excessive functionality, permissions and autonomy as root causes and advises enforcing authorisation in downstream systems rather than relying on the model; that advice applies whether you or the vendor wrote the agent.

Worked scenario: two agents in one CRM

A company runs an internal agent that drafts renewal quotes from CRM data, and is evaluating a vendor's AI sales agent that would read the CRM, send emails and update opportunities.

  1. Internal agent: runs under its own workload identity with read access to accounts and opportunities and write access only to a quote draft object. A human approves every quote before sending. Credentials are short-lived and issued by the cloud platform; logs include prompts and tool calls.
  2. Vendor agent, as proposed: asks a sales manager to consent with their own account, requesting full CRM API access and offline access (a refresh token). Actions would appear in the CRM audit log as the manager.
  3. Vendor agent, as admitted: the CRM administrator registers the vendor as a connected app with admin-approved access only, a dedicated integration user with a permission set limited to the objects the agent needs, restricted login ranges where supported, and a named business owner. Emails go out through a sending domain the company can monitor.
  4. Contract: revocation within a stated time on request, notification of token compromise, advance notice of new scopes, and a monthly export of agent action records for the company's tenant.
  5. Monitoring: alerts on bulk exports by the integration user and on access to objects outside the agreed set, the pattern seen in the Drift case.

The internal agent was governable by design; the vendor agent needed configuration, a dedicated identity and contract terms to reach a comparable level.

Decision criteria

  • Build internally when the agent needs write access to systems of record, touches regulated data, or must produce evidence you will be held to, and you have the skills to run it.
  • Buy a third-party agent when the task is well bounded, read-mostly, and the vendor supports admin consent, narrow scopes, a dedicated identity and log export.
  • Refuse or defer when the vendor needs a human user's broad token, cannot say how it stores credentials, or cannot revoke on request.
  • Small organisations: third-party agents are often the only realistic option; compensate with strict consent settings, quarterly grant reviews and a short list of approved agent vendors.
  • Large organisations: route vendor agent admission through a single intake that combines third-party risk, IAM and AI governance, and record every vendor principal in the same inventory as internal agents.

Implementation steps

  1. Inventory: list every internal agent identity and every third-party app, service principal, connected app and API key that belongs to an AI product. User-consented grants count. See How to Inventory third party oauth apps in google workspace.
  2. Close user consent for AI apps: require admin approval for new grants and route requests through an intake workflow.
  3. Re-scope existing vendor grants: move each vendor agent to a dedicated identity with minimum permissions; pilot with one vendor and keep the old grant disabled, not deleted, until the new one is proven.
  4. Standardise internal agent identity: agent-specific identities, owners and expiry for every internal agent.
  5. Add the agent clauses to new contracts and at renewal; test revocation with each critical vendor.
  6. Review on a cycle: recertify every agent identity and vendor grant at least quarterly. See Agent Identity Recertification.

Detection and measurement

  • Vendor grants with a named owner: share of third-party agent principals and keys with an accountable internal owner (target 100%).
  • Attributable actions: share of agent actions in your logs that identify the agent separately from the user.
  • Revocation time: measured time from decision to the last successful call by a revoked vendor agent.
  • Grant hygiene: number of AI app grants unused for 90 days, and number of user-consented grants with write or offline scopes.
  • Log availability: share of critical vendor agents whose action records you have obtained at least once.

Framework mapping

FrameworkInternal agentsThird-party agents
NIST SP 800-53 Rev 5AC-2 Account Management; AC-6 Least Privilege; IA-9 Service Identification and Authentication; AU-6 Audit Record ReviewSA-9 External System Services; SR-6 Supplier Assessments and Reviews; AC-6 on the vendor principal; AU-6 including vendor records
NIST CSF 2.0PR.AA-05 access permissions and least privilegeGV.SC-05 requirements in supplier contracts; GV.SC-07 supplier risk monitoring; GV.SC-10 provisions after the agreement ends; ID.AM-04 inventory of supplier services
ISO/IEC 27001:2022 Annex A5.15 Access control; 5.18 Access rights; 8.15 Logging5.19 Information security in supplier relationships; 5.20 Addressing information security within supplier agreements; 5.22 Monitoring, review and change management of supplier services
OWASP Top 10 for LLM Applications 2025LLM06 Excessive Agency applies to both; for vendor agents, enforce it through the scopes and identity you grant

Common failure patterns

  • Shadow AI consent on a corporate account: an employee signs up to an AI tool and grants it broad access; when the vendor is breached, the token opens the company. This is the pattern in the Vercel Context.ai OAuth Breach 2026.
  • Vendor agent acting as a person: the agent runs on a manager's refresh token, so its actions are indistinguishable from the manager's and the grant ends only when someone remembers it.
  • Treating revocation as instant: the grant is removed but scheduled jobs, cached data and secrets the agent could read are left in place. Rotate what the integration could see, as Drift customers had to.
  • Different standards for internal and vendor agents: internal agents go through review while vendor agents arrive through procurement with no IAM involvement, or the reverse.
  • No log access until an incident: the vendor's action records are requested for the first time during an investigation and turn out to be unavailable or retained for too short a period.

Practitioner checklist

  • Classify every agent by who holds its credentials and who can change its behaviour.
  • Require admin consent for AI apps and block user consent to broad or offline scopes.
  • Give each vendor agent a dedicated identity or key with minimum permissions, an owner and an expiry.
  • Use agent-specific identities with no long-lived secrets for internal agents.
  • Prefer delegation that keeps the agent visible (an actor claim or a separate principal) over impersonation.
  • Confirm in writing how each vendor stores your tokens and how fast it can revoke them, then test revocation.
  • Contract for advance notice of new scopes, model or sub-agent changes, and for export of agent action records.
  • Alert on bulk reads and new resource types by any agent principal.
  • Recertify agent identities and vendor grants at least quarterly and remove unused ones.

Standards and references

Related NHI Mgmt Group resources: Agent Identity and Access Guide · Consent Phishing and Illicit OAuth Grants Guide · AI Vendor Breach Response · Agent-to-Agent Authentication Guide

PDF for subscribers

Take this guide with you

Every section, table and checklist in one PDF, with links to the sources and related guides. Subscribe to our weekly NHI & AI Identity Journal and we’ll email you a download link.

Free weekly newsletter

Subscribe to the NHI & AI Identity Journal

The latest on NHI and Agentic AI security – articles, research, breaches, news and events every week.

Bonus 33% off our NHI Course when you subscribe.

NHIMG Editorial Note
Researched and written by the NHI Mgmt Group editorial team using AI tools, under the editorial direction of Lalit Choda. Facts are drawn from the sources listed on this page and checked by our automated quality process. Last updated 14 November 2026. Spotted an error? Use our contact page.
NHI Mgmt Group, the independent authority on Non-Human Identity, IAM and Agentic AI security. nhimg.org

PDF Downloads for Newsletter Subscribers

Get the guide

Enter your details and we’ll email you a download link.

The full guide is free to read online. The PDF is a thank you for subscribing.

Fill in all fields marked * and tick the PDF box to continue.