The engineering service-to-service authentication decision record: why the credential model you chose determines your service identity verification ceiling and your lateral movement surface

Service-to-service authentication is treated as a credential configuration detail — an API key in a secrets manager, a JWT signing key in an environment variable, a certificate delivered via a vault share — not as a founding architectural decision whose credential model, rotation policy, and scope isolation model determine whether a compromised internal service can reach one downstream target or every downstream target in the system. The credential mechanism chosen when Service B first calls Service A propagates its identity guarantee level, its credential binding model, and its rotation complexity to every subsequent service relationship. Three founding choices — the authentication mechanism, the credential lifecycle model, and the scope isolation model — determine how strongly a service can verify its caller's identity, how quickly a leaked credential can be contained, and how far an attacker who compromises one service can move laterally through the internal call plane.

A 19-person B2B SaaS building a workflow automation platform for operations teams had grown from a monolith to four services over eighteen months. The original monolith was split into four components: a Notifications service that sent in-app and email messages, a Billing service that managed subscription state and payment processing, an Analytics pipeline that aggregated usage events, and an Admin service that served the internal operations dashboard. Each service needed to call the others in various combinations — the Billing service called the Notifications service to send payment confirmation emails, the Admin service called all three for dashboard aggregation, and the Analytics pipeline received events from all three.

When the monolith was split, the founding engineer created a single API key — a 32-byte random string — stored in AWS Secrets Manager, and configured all four services to use it for authenticating inter-service calls. The receiving service validated the key against a hardcoded expected value read from its own environment variable at startup. The design was practical for the team's size: one key to manage, one place to rotate it, straightforward to reason about. The engineer noted in a Slack message that the key should eventually be replaced with per-service keys but the transition was deferred because the team was focused on shipping product features and the internal network was protected by VPC isolation anyway.

Seven months after the split, an engineer refactoring the infrastructure-as-code configuration for the Billing service copied the API key into a Terraform variable file to test a new secrets-loading approach. The file was committed to the team's private Git repository with the key in plaintext. The engineer realized the mistake forty minutes later, deleted the key from the file, committed the deletion, and mentioned it in the team Slack. The assumption was that the deletion commit had closed the exposure — the key was no longer in the repository's current state. The secret scanning tool the team used was configured to scan pull requests against the main branch HEAD, not the full commit history.

Eleven months after the commit, an SOC 2 Type II readiness audit conducted by an external assessor ran a full historical secret scan against the repository. The scan identified the plaintext API key in the commit from eleven months prior. The assessor flagged the finding as a critical open issue: the key had been in the repository's history for eleven months, accessible to anyone with repository access — including former employees who had been granted repository access during the same period — and there was no evidence the key had been rotated after the accidental commit.

Rotating the key required coordinating deploys of all four services simultaneously, because all four services validated the same key. A partial rotation — where the new key was deployed to some services before others — would cause the services still validating the old key to reject calls from services already using the new key, breaking inter-service communication during the transition window. The rotation was scheduled for a Saturday maintenance window. The process required all four services to be deployed in a coordinated sequence: deploy the Notifications service with both old and new keys accepted, deploy the Billing service with both keys accepted, deploy the Analytics pipeline with both keys accepted, deploy the Admin service with both keys accepted, then remove the old key from all four services in a second coordinated deploy. The rotation took six hours and required three engineers to coordinate the deploy sequence, monitor for failed calls during the transition, and roll back individual services when the Billing service's dual-key configuration had a logic error that caused both keys to fail validation for thirty-two minutes before the engineer identified the bug and pushed a fix.

A 37-person data platform company providing integration services for e-commerce analytics had a service-to-service authentication model built on JWT service tokens. Each service had a token issuance mechanism: when Service A needed to call Service B, Service A minted a JWT signed with the platform's shared symmetric HMAC-SHA256 signing key, included the calling service name and target service name as claims, and presented the token in the Authorization header. Service B validated the JWT signature against the same HMAC key and verified that the token's target service claim matched its own service name.

The design had been chosen during the original architecture phase for its operational simplicity. HMAC signing did not require key pair management or a PKI infrastructure. Any service with the signing key could both mint and verify tokens, which made local development and integration testing straightforward — an engineer could mint a valid token from their laptop by running a one-line Node script with the signing key. The signing key was stored in AWS Secrets Manager and injected into each service as an environment variable.

The same signing key was used in both the staging and production environments. Environment-specific keys had been discussed during an infrastructure planning sprint — the security-minded engineer on the platform team had flagged that a single key across environments meant a staging-minted token was valid against production services — but the sprint was deprioritized when a customer escalation required the team's full attention. The environment isolation was noted in a backlog item with medium priority and sat there for six months.

In the platform's fourteenth month, a senior engineer was debugging an anomaly in the production Internal Payments API. The anomaly was intermittent — it appeared in production but could not be reproduced in staging. The engineer, working from their local development environment, minted a service token for the Reporting service (the caller they were trying to simulate) targeting the Internal Payments API (the service they were debugging), using the signing key from their local environment configuration. Local environments used the staging signing key, which was the same as the production signing key. The engineer made a direct request to the production Internal Payments API endpoint using the staging-minted token.

The token was accepted. The production Internal Payments API validated the HMAC signature — which was valid, because the signing key was identical — and processed the request. The engineer reproduced the anomaly and filed a bug report. The debugging session worked exactly as intended. The signing key cross-environment failure was not noticed because the token was accepted, the request succeeded, and the engineer's focus was on the bug rather than on whether the authentication path was correct.

Six months later, a CI pipeline job running integration tests against the staging environment was updated by a junior engineer to include a debugging assertion that printed the full Authorization header of outbound requests to the job's stdout log. The job was running against staging — which used the production signing key — and minted service tokens for each test case. Forty-seven test cases minted staging-environment service tokens that were structurally valid against the production Internal Payments API, the production Order Processing service, and the production Customer Data service. All forty-seven tokens, each with a 60-minute TTL, were written to the CI job's stdout log. The CI job logs were accessible to all thirty-seven engineers in the company via the CI dashboard without any secrets-scanning or redaction configuration. The tokens were in the logs for fifty-three minutes before the platform team's automated secrets scanner identified the JWT format in the log output and flagged the exposure. All forty-seven tokens were still within their TTL window when the scanner fired.

The remediation required rotating the signing key — which, because it was shared across staging and production, required coordinating service restarts across both environments, invalidating all currently-valid service tokens, and accepting a brief period of authentication failures across all inter-service calls during the propagation window. The team also invalidated every service token that had been minted in the previous 60 minutes across both environments as a precautionary measure, triggering cascading re-authentication failures that produced customer-visible errors for eleven minutes before the new key had propagated to all services.

A 54-person B2B infrastructure company building a developer tooling platform had operated with a network-trust internal authentication model for the first two years of its operation: services within the production VPC trusted calls from other services in the same VPC without an explicit application-layer credential, using the VPC's network segmentation and security group rules as the access control boundary. The model was simple and had worked well at small scale.

In year three, a third-party security assessment recommended transitioning to mutual TLS for service-to-service authentication as the service count had grown to sixteen services, the team had hired engineers from outside the founding group, and the VPC trust model provided no protection against a compromised internal service making calls to other services as itself. The assessment recommended SPIFFE/SPIRE for workload identity or Istio for service mesh-level mTLS enforcement, but the platform team evaluated the operational complexity and decided to implement mTLS using their existing internal certificate authority — a Vault PKI secrets engine — with manual certificate issuance as the initial process, with the intent to automate it later.

The certificate issuance process required a service owner to submit a Jira ticket to the platform team specifying the service name, the service's DNS name inside the cluster, and the list of services it needed to call and be called by. The platform team generated a certificate, signed it with the internal CA, and delivered it to the requesting team via a secure 1Password vault share. The requesting team embedded the certificate path in the service's deployment configuration and updated their TLS client to present the certificate on outbound calls and their server to require client certificate verification on inbound calls. End-to-end, the process took between two and four business days depending on the platform team's queue depth.

Three months into the mTLS rollout, the first exception appeared. A team building a new data ingestion service needed it deployed within two days for a customer commitment. The service needed to call the existing Data Storage service and the Schema Registry service. The platform team's Jira queue was at a four-day SLA. The engineering team lead asked the platform team for an expedited path; the platform team suggested using the internal API gateway as a temporary workaround. The API gateway had been built eighteen months earlier to handle external API traffic and had been extended to handle internal routing between services. It had a middleware layer that read an X-Internal-Service header and used its value as the caller identity for routing decisions. The receiving service did not need to verify a TLS certificate — it trusted the gateway's routing decisions, and the gateway trusted the header.

The workaround was documented in the platform team's internal wiki under "Service onboarding: temporary paths" with a note that it was a bridge solution pending certificate issuance. The data ingestion service launched on time. The certificate Jira ticket was filed and sat in the queue. The certificate was issued ten days later. By that point the data ingestion service had been running against the gateway path for ten days, the engineers who built it had moved to the next project, and the migration to mTLS required re-testing the service's TLS configuration — work that was filed as a backlog item with medium priority.

Over the following fifteen months, the gateway path was used as the primary onboarding mechanism for seven additional new services. The platform team's mTLS queue was perpetually backlogged, the four-day SLA was treated as a soft guideline rather than a commitment, and the gateway trusted-header path was consistently faster. By month eighteen of the mTLS initiative, ten of the sixteen services in the production environment were communicating via the gateway's trusted-header path rather than via mTLS certificate verification. A new service calling the gateway with any value in the X-Internal-Service header could impersonate any service in the system, make requests to any downstream service that accepted gateway-routed traffic, and exfiltrate any data those services returned — all without possessing any service credential.

The security team identified the full scope of the trusted-header bypass during a routine access review. The remediation required deprecating the trusted-header gateway path and migrating ten services to mTLS certificate verification simultaneously — a project that the platform team estimated would take three months given the backlog of certificate issuance work, the need to coordinate certificate deployment with each service team, and the requirement to maintain the gateway path until all ten services were migrated. The three-month migration window was three months during which the bypass path remained available.

Structural properties set by the service-to-service authentication decision

Two structural properties are determined by the founding decisions about credential mechanism, credential lifecycle, bootstrapping model, and scope isolation. Both are invisible during early development when the service count is small and all engineers have full context on the internal call plane. Both become visible under growth conditions: when services are added faster than the credential model can accommodate, when engineers join who do not have founding context, and when security reviews examine the internal authentication surface.

Property 1: Service identity verification ceiling. The service identity verification ceiling is the strongest guarantee any service can achieve that an incoming request was made by an authorized caller — the highest confidence the receiving service can place in the identity and authorization of the calling service, bounded by the properties of the authentication model the team has established. Three components. The credential binding component: the guarantee provided by any service authentication credential is exactly as strong as the binding between the credential and the calling service's identity. A long-lived API key bound only by knowledge — the caller has the key — provides a guarantee of "the caller possessed a string of bytes" rather than "the caller is a specific deployed instance of a specific service." A JWT service token signed with a symmetric key provides a guarantee of "the caller possessed the signing key and minted a structurally valid token" rather than "the caller is a specific workload" — and because any service with the signing key can mint tokens, the token does not distinguish between services by design. A JWT signed with an asymmetric key provides "the caller possesses the private key," where private key custody is bounded by the token issuance infrastructure's security. A certificate in a mutual TLS handshake provides "the caller possesses the private key corresponding to a certificate signed by a CA that this service trusts, and the certificate subject matches the expected service identity" — the strongest workload binding of the four mechanisms. The ceiling on the identity guarantee is set by the credential type at the time of adoption, and migrating to a stronger guarantee level after the original mechanism is entrenched requires a coordinated cross-service migration. Connect to the zero-trust network access decision record: the zero-trust network access decisions that govern whether services trust each other based on network position (VPC membership, subnet membership, security group membership) or based on explicit workload identity (certificate subject, service account, instance identity document) set the floor on the service identity verification ceiling; a network-trust model provides a ceiling of "the caller is in the same network segment" regardless of which application-layer credential mechanism is layered on top; a workload-identity model provides a ceiling bounded by the specific credential mechanism chosen. The credential scope isolation component: even when the credential type provides a strong guarantee of caller identity, the ceiling is bounded by the scope assigned to each credential. When all services share a single credential — a shared API key, a single JWT signing key, a wildcard certificate with a broad subject alternative name — a caller that obtains that credential through any path is indistinguishable from any authorized service using the same credential. Per-service credential isolation — each service has its own key, its own JWT signing authority separate from other services, or its own certificate with a subject bound to its specific identity — raises the ceiling by ensuring that a compromised credential for one service cannot be used to impersonate a different service. The scope isolation component requires both that credentials are per-service (isolation) and that each service's credential is accepted only by the specific services it is authorized to call (least-privilege call authorization). Connect to the secrets management decision record: the secrets management decisions that govern how credentials are stored, accessed, and rotated determine the operational ceiling on per-service credential isolation; a secrets management model that makes per-service credentials as easy to manage as shared credentials enables the isolation model; a model that makes per-service credentials significantly more complex to manage (manual issuance, manual rotation, manual vault shares) creates the operational incentive to collapse to shared credentials that produced the first failure pattern. The credential freshness component: the ceiling is bounded by how recently the credential was verified as still valid. A credential not rotated in twelve months may have been compromised eleven months ago; the exposure window — the interval between compromise and rotation — is a period during which an attacker has service-level identity indistinguishable from an authorized service. Shorter rotation intervals or automated rotation with short-lived credentials (15-minute JWT tokens, 24-hour certificates) reduce the exposure window component of the ceiling by bounding the period during which a compromised credential remains valid, independent of when the compromise is detected.

Property 2: Lateral movement surface. The lateral movement surface is the aggregate attack surface that an attacker who has compromised one internal service can exploit to reach other services, exfiltrate data, or escalate privileges within the internal call plane — bounded by the credential isolation model, the credential scope model, and the internal network trust model. Three components. The credential isolation failure component: when multiple services share a single credential — a shared API key, a shared JWT signing key, a wildcard certificate — compromising any one service that has access to the credential gives the attacker the same credential as all other services that use it. The attacker's lateral movement capability at the point of service compromise is equivalent to the union of all permissions granted to the shared credential across all services and all endpoints that accept it. In a microservices architecture where eight services share a single API key, compromising the least-privileged service (a low-traffic analytics collector) provides the credential that the most-privileged service (the billing processor) also uses; the attacker gains billing processor-level access from analytics collector-level compromise. The lateral movement surface created by shared credentials is proportional to the number of services sharing the credential and to the maximum permission scope granted to that credential anywhere in the system. Connect to the service mesh decision record: the service mesh decisions that govern whether to adopt a service mesh (Istio, Linkerd, Consul Connect) and which policy enforcement model to use directly affect the lateral movement surface; a service mesh with mutual TLS enforcement and per-service authorization policies implements workload identity and least-privilege call authorization at the infrastructure layer, bounding the lateral movement surface at each service's declared upstream dependencies rather than at the global credential scope; teams that adopt a service mesh but do not configure per-service authorization policies (allowing all services to call all services as long as mTLS is established) reduce the credential isolation failure component of the lateral movement surface but do not reduce the scope granularity failure component. The internal network trust failure component: when service-to-service authentication relies on network-layer trust — a service is trusted because it communicates from a known IP range, VPC, Kubernetes namespace, or because it carries a header that the internal gateway trusts — the lateral movement surface expands to any workload that can achieve network adjacency. A compromised service in the production VPC, a misconfigured network policy that grants a staging workload access to a production subnet, or a supply chain compromise of a dependency running in the production cluster are all paths to network adjacency that the network-trust model treats as equivalent to authorized service identity. The transition from network-trust to workload-identity authentication reduces the lateral movement surface by requiring a credential tied to the calling workload's identity rather than to its network position, but only if the network-trust path is fully eliminated — a hybrid model where most services use workload identity but a gateway's trusted-header path remains available provides a lateral movement surface bounded by the least-secure path, not the most-secure path. Connect to the identity provider decision record: the identity provider decisions that govern which identity and authentication infrastructure the team uses for human-facing authentication (OAuth, SAML, OIDC) may also govern the service identity infrastructure; teams that extend their user identity provider to issue service tokens (treating services as machine accounts in the user directory) inherit the user identity provider's availability guarantees for the service authentication path, but gain a unified audit log of both human and service authentications across the internal call plane. The scope granularity failure component: even when credentials are per-service and not shared, the lateral movement surface is bounded by what each service's credential authorizes it to call. A service that is authorized to call every other service in the system provides an attacker with full internal call plane access on compromise; a service that is authorized to call only the specific two services it needs in its production workflow limits an attacker to those two services' APIs. The scope granularity component requires that each service's credential is scoped to the minimum set of downstream services it needs to call in production — not to a broad authorization class that includes services it might theoretically need to call in future. Connect to the API rate limiting decision record: the API rate limiting decisions that govern per-caller rate limits on internal service endpoints affect the lateral movement surface's damage potential — an attacker who has compromised a service and is using its credential to exfiltrate data is bounded by the per-caller rate limits on each downstream service's endpoints; per-service rate limits calibrated to the expected normal call volume provide a detection opportunity (anomalous call rate triggers an alert) and a damage-limiting mechanism (exfiltration throughput is bounded by the rate limit) even after a service credential is compromised.

The service-to-service authentication ADR: five sections

Section 1: Authentication mechanism selection. The authentication mechanism selection defines which credential type the team will use for service-to-service calls, the rationale for that selection, and the conditions under which the team would migrate to a stronger mechanism. The ADR must address three mechanism options explicitly rather than selecting by default. Long-lived API keys are appropriate when the service count is small (fewer than six services), when each key is per-service rather than shared across multiple services, when key rotation is automated (not manual), and when the rotation interval is short (days, not months). The ceiling on the identity guarantee is "the caller possesses the key" — not workload-bound identity — which is acceptable when key compromise would be detected quickly (automated secret scanning on all code repositories including history, alerting on anomalous call volumes from any caller) and when the blast radius of key compromise is limited by per-service key isolation. API keys are inappropriate when the service count exceeds the team's ability to manage per-service keys manually, when rotation requires coordinated multi-service deploys, or when compliance requirements demand workload-level identity. JWT service tokens with asymmetric signing are appropriate when the team needs short-lived credentials (reducing the exposure window without requiring revocation infrastructure), when the receiving service needs to verify caller identity offline (without calling an identity service on each request), and when the team needs to embed authorization claims alongside identity claims. Asymmetric signing is required (not symmetric) to prevent services from minting tokens for other services. The token TTL should be set to the minimum viable duration given the token refresh overhead — 15 minutes for high-frequency inter-service calls, up to 60 minutes for lower-frequency calls — with automated refresh before expiry handled by the service's authentication middleware, not by the application code. Mutual TLS is appropriate when the team has a service mesh that handles certificate issuance, rotation, and mTLS enforcement automatically, or when the compliance posture requires workload-level identity binding verified at the TLS layer. Manual certificate issuance processes are explicitly disqualified as the operational certificate model — the ADR must specify that any mTLS implementation requires automated certificate issuance with a bootstrapping time of less than five minutes for new services, or the operational friction will produce bypass mechanisms that negate the security benefit. Connect to the service mesh decision record: if the team has adopted a service mesh, the mesh's certificate management capabilities are the input to the mTLS selection; if the team has not adopted a service mesh, the operational complexity of automated certificate management must be evaluated as part of the mTLS adoption decision — adopting mTLS without a service mesh or without an equivalent automation layer reproduces the third failure pattern.

Section 2: Credential lifecycle model. The credential lifecycle model defines how credentials are issued, how long they remain valid, how they are rotated, and how they are revoked. The ADR must specify the lifecycle for each credential type the team uses. For API keys: the key issuance process (automated via a credential management service or manual with a documented procedure), the key rotation interval (maximum 90 days for compliance-sensitive services; 30 days for payment and authentication services), the rotation procedure (dual-credential acceptance window, deploy sequence, old key revocation timeline), and the revocation procedure (how to revoke a key that has been compromised before its rotation interval has elapsed — typically by removing the key from the receiving service's accepted-keys configuration, which must be hot-reloadable rather than requiring a service restart). For JWT service tokens: the token TTL (minimum 15 minutes, maximum 60 minutes for typical inter-service calls), the signing key rotation interval (90-day maximum; asymmetric keys are rotated by publishing the new public key to the JWKS endpoint and removing the old public key after the previous token TTL has elapsed), the token issuance mechanism (sidecar, middleware, or service-level library), and the token refresh model (automatic refresh before expiry handled by the authentication middleware rather than by application code). For mTLS certificates: the certificate validity period (24 hours for automated CA; 30 days maximum for certificates issued through any process with human latency), the certificate rotation model (automated renewal before expiry via cert-manager, Vault PKI dynamic secrets, or SPIFFE/SPIRE), and the certificate revocation model (OCSP or CRL for revocation before expiry; the ADR must specify whether revocation checking is online or offline and what the latency and availability implications are). The critical failure mode for all credential lifecycle models is the rotation process that is documented but not tested: the team documents a rotation procedure, never executes it because all credentials are within their validity window, and discovers in a forced rotation event (a credential exposure incident, an SOC 2 audit finding) that the documented procedure has gaps — the dual-credential window logic has a bug, the deploy sequence has a dependency that was not documented, the revocation mechanism requires a service restart that takes twelve minutes rather than the expected thirty seconds. The ADR must specify that the rotation procedure is tested on a scheduled cadence (at least annually for all credential types) and that any rotation procedure that has not been tested within the previous twelve months is treated as untested for incident response planning purposes. Connect to the secrets management decision record: the secrets management decisions that govern which secrets store is used (AWS Secrets Manager, HashiCorp Vault, GCP Secret Manager, Kubernetes Secrets), how services access their secrets at runtime, and whether secrets are injected at deploy time or loaded at runtime determine the feasibility of hot-reloadable credential rotation; services that read credentials once at startup and cache them in memory cannot rotate credentials without a restart; services that load credentials from the secrets store on each request or on a TTL-based refresh interval can rotate credentials without a service restart — the ADR must specify the runtime credential loading model to make zero-downtime rotation achievable.

Section 3: Service bootstrapping model. The service bootstrapping model defines how a new service receives its initial credentials — the mechanism that resolves the circular dependency between needing credentials to authenticate to the credential issuance service and not having credentials yet. The ADR must specify a bootstrapping process whose latency is compatible with the team's service deployment cadence. The viable bootstrapping models by credential type. For API keys: an operator places the new service's first key in the secrets store before the service is deployed; the key is a one-time bootstrap secret distinct from the operational keys; the service uses the bootstrap key to register itself with the credential management service and receive its operational key; the bootstrap key is then rotated or deleted. The bootstrapping process is documented as a runbook, automated where possible (Terraform module, deploy pipeline step), and can complete in under 30 minutes for any new service. For JWT service tokens with an internal token issuance service: the new service receives a bootstrap identity credential (a Kubernetes service account token, a cloud provider instance identity document, a Vault AppRole or JWT auth method credential) bound to the service's deployment identity rather than to any application-level secret; the service uses the bootstrap credential to authenticate to the token issuance service and receive its signing keypair or its first issued token; the bootstrap credential is managed by the deployment platform (Kubernetes, the cloud provider's IAM, the CI/CD system) rather than by the application team, eliminating the need for a manually delivered secret. For mTLS: the bootstrapping model must be automated — the ADR explicitly prohibits manual certificate issuance as the bootstrapping mechanism for new services. The acceptable bootstrapping paths are SPIFFE/SPIRE (the SPIRE agent on the node issues an SVID to the new service's workload based on a Kubernetes service account selector), cert-manager with an automated CSR approval policy, or Vault PKI with an AppRole or Kubernetes auth method that the new service uses to authenticate to Vault and request its first certificate. The bootstrapping time requirement — new service receives its first certificate within five minutes of deployment, with no manual steps — must be verified in a test environment before the mTLS rollout begins. The ADR must specify the bootstrapping SLA explicitly and document the escalation path if bootstrapping fails (which service does the new service call without its certificate during the bootstrapping window, and what is the security implication of that fallback). Connect to the zero-trust network access decision record: the zero-trust network access decisions that govern the platform-level identity substrate — Kubernetes service accounts, cloud provider instance identity, SPIFFE trust domain — are the foundation on which the service authentication bootstrapping model is built; the bootstrapping model must be evaluated against the specific platform-level identity mechanisms available in the team's deployment environment, not against abstract models.

Section 4: Credential scope and isolation model. The credential scope and isolation model defines whether credentials are per-service or shared, what each credential authorizes its holder to call, and how authorization scope is enforced by receiving services. The ADR must address two dimensions explicitly: credential isolation (each service has its own credential, not shared with other services) and call authorization scope (each service's credential authorizes only the specific downstream services it needs to call). Credential isolation is a binary property: either each service has its own credential, or credentials are shared. The ADR specifies that shared credentials — a single API key accepted by all services, a single JWT signing key shared across the platform — are not permitted because they eliminate the ability to scope a credential revocation to a single service and because they make per-service anomaly detection (unusual call volume from Service A's credential) impossible when the credential is not service-specific. The only exception is a shared credential for a specific well-defined use case (a read-only internal metrics credential shared by monitoring sidecars) with the exception explicitly documented, the shared credential scoped to a minimum permission set, and a plan for per-service migration when the service count exceeds a specified threshold. Call authorization scope: the credential issued to each service authorizes it to call a specific list of downstream services — not "all internal services" and not "all services within a specific network segment." The receiving service enforces the authorization scope by verifying that the caller's credential claims include an authorization for the specific endpoint being called, or by consulting an authorization policy (a Kubernetes NetworkPolicy, an Istio AuthorizationPolicy, a Vault ACL policy) that specifies which callers may call which endpoints. The scope is documented per service in the ADR: Service A is authorized to call Service B's read endpoints and Service C's write endpoint at path /events; Service A is not authorized to call Service D or any endpoint on Service B other than the read endpoints. The scope document is the formal specification against which the authorization policy is configured; it is updated when new service-to-service call patterns are added, and the update process requires a code review to prevent scope expansion without review. Connect to the identity provider decision record: the identity provider decisions that govern the claims format in service tokens — which claims fields encode identity, which encode authorization scope, what the validation logic is for each — determine how receiving services implement scope enforcement; a claims format designed for human OIDC tokens (sub, email, groups) requires adaptation for machine-to-machine service tokens (service-name, authorized-upstreams, environment); the ADR specifies the claims format for service tokens explicitly rather than reusing the human claims format, so the authorization logic in each receiving service can be audited against the claims spec.

Section 5: Cross-environment isolation model. The cross-environment isolation model defines how service credentials are separated between environments (development, staging, production), what prevents a credential minted in one environment from being accepted in another, and how developers authenticate for local development and testing without using production credentials. The ADR must specify the environment isolation model explicitly rather than treating it as a deployment configuration detail. The critical failure mode is a symmetric signing key or a CA certificate that is shared across environments — specifically across staging and production — which means a credential minted in staging is accepted by production services, a compromised staging credential has production blast radius, and a CI pipeline running against staging can produce credentials that work in production. Environment isolation mechanisms by credential type. For API keys: each environment has its own set of API keys; a production key is never stored in a staging environment's secrets store or a development environment's configuration; the key naming convention encodes the environment (service-payments-prod, service-payments-staging) so accidental cross-environment use produces a recognizable credential name in access logs rather than an opaque string. For JWT service tokens: each environment has its own asymmetric signing key pair; the production signing private key is stored only in production secrets management, never in staging or development; the JWKS endpoint for each environment publishes only its own environment's public key; a token signed with the staging private key fails validation against the production JWKS endpoint because the staging public key is not in the production JWKS response. For mTLS: each environment has its own internal CA; the production CA's root certificate is not installed in staging services as a trusted root, and the staging CA's root certificate is not installed in production services; a staging certificate fails validation against a production service because the production service does not trust the staging CA; the CA isolation is enforced by the certificate issuance infrastructure, not by deployment-time configuration that could be overridden. Developer authentication for local development: developers do not use production credentials for local development or for integration tests that run from their local environment. The local development credential model is documented in the ADR: developers use a development-environment credential (a development API key, a development JWT signing key, a development certificate from the development CA) that is accepted only by the development or staging environment's services; the production environment's receiving services reject development credentials by design. The staging-to-production isolation is validated as part of the production deployment checklist: before any production deployment of a service that accepts service credentials, the deployment checklist includes a step to verify that the staging CA root certificate is not in the production trusted roots bundle and that the staging JWKS endpoint URL is not in the production token validation configuration. Connect to the secrets management decision record: the secrets management decisions that govern environment separation in the secrets store — whether staging and production secrets are in the same secrets store (with separate paths) or in separate stores with separate access controls — affect the operational isolation of service credentials; a single secrets store with environment-specific paths is not equivalent to separate stores with separate IAM policies if a developer or a CI pipeline with staging access can read the production path; the cross-environment isolation model must specify the secrets store access control model, not just the credential naming convention.

FAQ

When should you use mTLS versus JWT service tokens versus API keys for service-to-service authentication?

The choice between mTLS, JWT service tokens, and API keys for service-to-service authentication turns on three variables: how strong a service identity guarantee you need, how much operational complexity you can sustain, and how quickly your service topology changes. API keys are appropriate when the service topology is small and stable (fewer than six services, infrequent new service additions), when each API key is per-service rather than shared, and when key rotation is automated with short rotation intervals (days, not months). The ceiling on the identity guarantee is "the caller possesses the key" rather than "the caller is a specific deployed workload" — acceptable when key exposure would be detected quickly and the blast radius of compromise is bounded by per-service isolation. JWT service tokens signed with asymmetric keys are appropriate when you need short-lived credentials that expire automatically, when you need caller identity claims verifiable offline, and when you need to embed authorization claims alongside identity claims; asymmetric signing is required (not symmetric HMAC) to prevent any service from minting tokens for other services. Mutual TLS provides the strongest workload identity guarantee — the certificate subject is bound to the calling workload's identity, verified at the TLS layer before application code executes — and is appropriate when you have a service mesh or certificate automation infrastructure that handles issuance and rotation automatically. The operational requirement for mTLS is non-negotiable: manual certificate issuance processes of two to four days produce the operational incentive for bypass mechanisms that eliminate mTLS's security benefit entirely. If you cannot automate certificate issuance with a bootstrapping time under five minutes, choose JWT service tokens over manual mTLS — the JWT model provides better operational characteristics for the same team, even at a slightly lower identity guarantee level, as long as keys are asymmetric and environment-isolated.

How do you handle the bootstrapping problem — how does a new service get its initial credentials?

The bootstrapping problem in service-to-service authentication is the chicken-and-egg dependency: to authenticate to the credential issuance service to get credentials, the new service needs credentials — but it does not have them yet. The viable resolution paths depend on the deployment platform. For Kubernetes-based services, the platform-level identity substrate is the Kubernetes service account: each pod has a service account token that Kubernetes injects automatically and that is accepted by SPIFFE/SPIRE, cert-manager, and Vault's Kubernetes auth method as a first-party identity proof. The new service uses its Kubernetes service account token to authenticate to the credential issuance service and receive its application-level credential (certificate, signing keypair, or API key) without any manually delivered bootstrap secret. For cloud-hosted services, the cloud provider's instance identity document (AWS instance identity document, GCP service account token, Azure managed identity) serves the same role — a first-party platform credential that the service has at startup and can use to bootstrap its application-level credential. The critical property of a valid bootstrapping model is that it uses a platform-issued identity — not a manually delivered application-layer secret — as the first credential, so the bootstrapping process is automated, auditable, and consistent across all new services. Manual bootstrapping models (operator places the first key in the secrets vault, sends the certificate via a vault share) are not repeatable at scale, produce human error, and create the operational incentive to skip the bootstrapping step and use a shared credential instead. Document the bootstrapping SLA in the ADR: new services should receive their first credential within five minutes of deployment, with no manual steps. If this SLA is not achievable with the current infrastructure, that is a finding — not a reason to defer the credential model decision.

How do you rotate service-to-service credentials without causing downtime?

Credential rotation without downtime requires that the receiving service accept both the old and new credentials simultaneously during a rotation window — the dual-credential acceptance window. The rotation procedure varies by credential type. For API keys: issue the new key while the old key remains valid; deploy the calling service to use the new key; verify the calling service is healthy and using the new key; revoke the old key. The dual-credential window runs from new key issuance to old key revocation. For the receiving service, this requires loading accepted keys from a hot-reloadable configuration (a secrets store with a TTL-based refresh) rather than from environment variables read at startup — services that require a restart to pick up a new accepted key cannot support zero-downtime rotation. For JWT tokens with asymmetric signing: publish the new public key to the JWKS endpoint alongside the old public key; switch the token issuance service to sign new tokens with the new private key; wait for all old-key tokens to expire (bounded by the token TTL — 15-minute tokens mean the rotation window closes in 15 minutes); remove the old public key from the JWKS endpoint. The token TTL is the rotation window duration: short TTLs make rotation faster. For mTLS certificates: the receiving service trusts any certificate signed by the CA it trusts, regardless of which certificate the calling service presents, so rotation is transparent — the calling service's certificate is renewed before expiry and the receiving service sees a valid new certificate during the renewal window. The mTLS rotation process requires only that the new certificate is delivered before the old one expires, not that any receiving service is updated. Test the rotation procedure annually: execute it in staging, verify that no calls fail during the rotation window, verify that the old credential is fully revoked after the rotation, and document any gaps between the documented procedure and what actually happened during the test.

How do service-to-service authentication decisions connect to AI chat sessions and decision preservation?

Service-to-service authentication decisions are made when the second service is built — the founding engineer needs Service B to call Service A, opens an AI chat session to work through the credential mechanism, and makes a set of choices whose consequences only become visible months later when the team grows, the service count doubles, the first credential rotation is required, or the first security audit reviews the internal call plane. The decisions made in those sessions — whether to use API keys or JWT tokens or mTLS, whether credentials are shared or per-service, whether rotation is manual or automated, what the bootstrapping process is, how staging and production credentials are isolated — are almost universally made once and never formally documented, leaving every engineer who joins the team afterward to infer intent from the credential files in the secrets vault, the rotation runbook buried in a wiki, and the gateway configuration that nobody fully understands. The engineer who asks "why does the Notifications service use an API key but the Payments service uses JWT tokens" will get "that's how it was set up" rather than the founding reasoning — unless the AI chat sessions that made those decisions were run through the open-source extractor and the decision record was produced at the time the service was built. The decision record allows the engineer inheriting the service authentication model to understand why API keys were chosen for the Notifications service (at three services and no security review requirement, the operational simplicity of API keys outweighed the stronger identity guarantees of JWT tokens; the decision record specifies the trigger for migrating to JWT tokens — when any service's credential is shared across more than two callers or when an SOC 2 audit is initiated); why the JWT signing key rotation process requires a coordinated deploy rather than automatic rotation (the token verification library was pinned to a single key rather than a JWKS endpoint at build time — the decision record specifies the JWKS migration path so the next rotation can happen without a deploy); and why the internal API gateway trusts the X-Internal-Service header for some service routes but requires certificate verification for others (the header-trust routes were added during an incident as a temporary expedient — the decision record specifies that all header-trust routes must be migrated to certificate verification by a specific date and flags the routes by name, so the technical debt is bounded and scheduled rather than invisible).