Google Cloud Application Default Credentials are a set of rules for finding credentials that client libraries use to authenticate to Google Cloud APIs. They let applications use user credentials, service account credentials, or workload identity from the local environment or metadata service without hard-coding secrets.
How Google Cloud Application Default Credentials work
Application Default Credentials, or ADC, is a search and fallback model for authentication in Google Cloud client libraries. Rather than hard-coding a key into code, ADC looks for credentials in the local environment first and then falls back to attached service account or workload identity sources that Google Cloud can supply at runtime.
This matters because the credential source is part of the application’s trust boundary. If the environment is configured correctly, ADC can reduce secret sprawl and let the same code run across laptops, CI, VMs, and managed services without changing authentication logic.
Where ADC gets credentials from
ADC is not one credential type. It is a set of rules for resolving whichever credential source is available and appropriate for the runtime. In practice, that can mean end-user credentials during local development, service account credentials for automation, or metadata-server based credentials on Google Cloud workloads.
The order of resolution matters because it determines which identity the application actually presents to Google Cloud APIs. That is why seemingly small environment differences, such as a missing variable or an unexpected local login, can produce confusing authentication results.
For Google Cloud users, the most useful mental model is that ADC is a discovery mechanism, not a permission grant. The application still needs a valid identity and the right IAM bindings, but ADC decides how the client library finds the material needed to authenticate.
Why ADC is used instead of hard-coded secrets
ADC is designed to avoid embedding long-lived keys in source code, container images, or configuration files. That reduces the chance that a copied repository, leaked build artifact, or exposed deployment manifest turns into immediate cloud access.
In a well-run environment, ADC supports a stronger pattern than “store a secret and ship it around.” It encourages runtime identity, short-lived credentials, and platform-managed auth paths. That is especially important when applications move between local development, test environments, and production services.
When teams misuse ADC, the failure is often not the library itself but the surrounding operational pattern. For example, using a downloaded service account key where a managed workload identity would work creates a much larger exposure window than the application actually needs.
Common failure modes and how to think about them
ADC problems usually surface as missing credentials, the wrong account being selected, or a credential source that works locally but fails in production. Those failures often trace back to environment drift, misconfigured runtime identity, or reliance on a credential file that was never meant to be long lived.
A second class of problems is over-permissioning. ADC can make authentication convenient, but it does not make authorization safe. If the resolved identity has excessive IAM privileges, the application can still read or change far more than it should.
For this reason, ADC should be understood as part of the access path, not the control outcome. The application still needs least privilege, clear ownership of the credential source, and a deliberate choice between human credentials, service account credentials, and federated or workload-based identity.
Risk and Threat Considerations
ADC can become risky when teams treat convenience as a substitute for credential hygiene. The main exposure is not the lookup logic itself, but the fact that a misconfigured environment can silently shift an application onto a more privileged or longer-lived credential than intended.
Failure mechanism: Attackers and insiders commonly benefit when developers leave exported environment variables, local login state, or downloadable service account keys on disk. If ADC resolves one of those sources, the application may authenticate successfully even though the underlying credential has broader access or should never have been used in production.
Impact: That can lead to unauthorized API access, lateral movement through cloud permissions, secret theft, or persistence through a reused credential source. If a key or token used by ADC is compromised, the blast radius is determined by the identity’s privileges and lifetime, not by the client library itself.
Standards & Framework Alignment
This section maps relevant standards and security frameworks to the operational risks and controls described in this guidance.
OWASP Non-Human Identity Top 10 addresses the attack and risk surface, while NIST SP 800-53 Rev 5 and OWASP ASVS set the governance and control requirements practitioners need to meet.
| Framework | Control / Reference | Relevance |
|---|---|---|
| NIST SP 800-53 Rev 5 | IA-5 — Authenticator Management | ADC depends on managing the lifecycle of API keys, tokens, or credentials used to authenticate. |
| IA-9 — Service Identification and Authentication | ADC commonly authenticates workloads and services to Google Cloud APIs at runtime. | |
| AC-6 — Least Privilege | ADC selects an identity, but authorization risk depends on the permissions granted to that identity. | |
| Recommendation — Restrict and rotate the credential material ADC can resolve, and remove stale or exposed authenticators. Use managed workload authentication instead of embedding reusable service credentials. Limit the permissions attached to every ADC-resolved identity to the minimum required. | ||
| OWASP ASVS | V10 — OAuth and OIDC | ADC often resolves federated or token-based authentication flows around cloud API access. |
| Recommendation — Validate cloud auth flows so client libraries only accept intended identity and token sources. | ||
| OWASP Non-Human Identity Top 10 | NHI-02 — Secret Leakage | ADC fails safely only when credentials are not leaked into files, code, or images. |
| NHI-07 — Long-Lived Secrets | ADC is often used to avoid long-lived keys and prefer short-lived runtime credentials. | |
| Recommendation — Eliminate hard-coded or downloaded secrets from ADC-backed deployments. Replace reusable keys with ephemeral credential sources wherever ADC supports them. | ||
Practitioner Guidance
Why practitioners should care: ADC works best when it is paired with managed identity patterns rather than a culture of downloaded keys. The practical question is not whether the application can authenticate, but whether it authenticates in a way that is auditable, revocable, and appropriate for the runtime.
Common misunderstanding: Many teams assume that because ADC is “automatic,” it is also safe by default. In reality, ADC can just as easily discover a local developer credential as a workload identity, so the surrounding deployment standards and IAM design decide whether the outcome is strong or brittle.
NHIMG’s How to fix Google Cloud Application Default Credentials errors without downloading keys is the most direct troubleshooting guide when the library cannot resolve the right source, and the Google Cloud Security Guide gives the broader platform context for IAM, service account keys, and federation.
Practitioner takeaway: Prefer runtime-managed identities and short-lived auth paths, then verify that ADC resolves the credential source you intended, not merely one that happens to work.
Related resources from NHI Mgmt Group
- How should security teams implement just-in-time secret access for workloads that need both cloud credentials and application secrets?
- Why do weak application-level credentials create risk even when other cloud security checks pass?
- How should security teams use Google Cloud organisation policies to reduce risky default permissions without breaking legitimate workloads?
- What breaks when a default cloud service account has broad project permissions and full API access in Google Cloud?
Deepen Your Knowledge
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.
Reviewed and updated by the NHIMG editorial team on November 18, 2026.
NHI Mgmt Group — the #1 independent authority on Non-Human Identity, IAM, and Agentic AI security. nhimg.org