By NHI Mgmt Group Editorial TeamBased on Cerbos: “Deploying Cerbos PDP on AWS Lambda and API Gateway: Step-by-step guide” (July 29, 2025)

TL;DR: Separating authorization logic from application code can make access control easier to test and audit in serverless stacks, as Cerbos’ Lambda pattern shows with API Gateway, S3-hosted policies, and stateless policy decisions according to Cerbos. The governance challenge remains unchanged: moving policy out of code does not remove the need to secure the identities, endpoints, and policy stores that govern access.


At a glance

What this is: This is a serverless authorization guide showing how Cerbos can run as a Lambda-based policy decision point while the real security burden shifts to IAM, API Gateway, and S3 trust boundaries.

Why it matters: It matters because identity teams need to treat externalised authorization as part of the access-control boundary, not as a substitute for securing the identities and endpoints that deliver policy decisions.


Context

Modern serverless authorization often fails at the boundary rather than inside the policy logic itself. When policy decisions move out of application code, the remaining trust chain shifts to the identities, endpoints, and storage locations that supply, execute, and serve those decisions.

In this pattern, Cerbos acts as a stateless policy decision point while AWS API Gateway fronts requests, Lambda executes the service, and S3 stores policies. That makes authorization easier to inspect, but it also creates a governance requirement around who can call the decision service and who can change the policy source.

The article is about operationalizing policy-as-code in a serverless environment, but the deeper lesson is that decoupling logic does not decouple trust. For IAM and NHI programmes, the control question becomes whether the authorization plane itself is protected with the same discipline as the application it governs.


Key questions

Q: How should security teams govern serverless authorization services?

A: Treat the authorization service as a privileged control plane, not a utility. Separate policy administration, runtime invocation, and deployment rights into different roles, then require strong authentication and logging around every policy change. The goal is to make access decisions testable without making the decision system easy to tamper with.

Q: Why do serverless authorization patterns still need strict IAM controls?

A: Because moving policy logic out of code does not remove the trust relationship around who can call the decision point and who can change the policy source. IAM controls govern both sides of that boundary. Without them, the PDP may be accurate, but it is still serving decisions to the wrong caller or from the wrong policy state.

Q: What are the signs that externalized authorization is becoming hard to govern?

A: Watch for policy changes that only one team understands, repeated debugging of deny decisions, and growing reliance on custom wrappers or undocumented inputs. Those are signs that the authorization model is technically working but operationally fragile, which is usually where scale problems start to appear.

Q: Why does policy as code reduce risk compared with embedding authorization checks directly in application logic?

A: Policy as code reduces risk because authorization rules stay separate from the application, so teams can update access rules without rewriting business logic. It also creates a single source of truth for decisions, which limits duplication, makes reviews more consistent, and improves auditability. In dynamic systems, that separation is usually easier to govern than scattered imperative checks.


Technical breakdown

How a stateless policy decision point works in serverless

A Policy Decision Point, or PDP, evaluates a request against policy and returns allow or deny without holding application state. In this pattern, the application sends subject, resource, and action context to Cerbos, and the PDP evaluates roles, attributes, and rules stored outside the code path. That separation improves testability and policy versioning, but it also means the authorization service becomes a dependency that must itself be authenticated, authorised, and monitored. In serverless deployments, the PDP is only as trustworthy as the API route and storage backend that deliver its policies.

Practical implication: Treat the PDP as a protected control plane service, not as a convenience library moved into Lambda.

Why API Gateway becomes part of the authorization boundary

API Gateway is the front door to the Lambda-based PDP, so it defines who can reach the decision engine and under what conditions. The article points to JWT authorizers, IAM authorizers, VPC links, WAF rules, and allowlists as boundary controls because an exposed authorization endpoint can be abused for policy probing, denial of service, or unauthorised decision requests. In other words, the request path is part of the identity model. If the calling service is not authenticated, the PDP is making decisions for an untrusted requester, which undermines the whole architecture.

Practical implication: Lock down the request path with strong caller authentication and network controls before trusting policy decisions in production.

Why S3-hosted policies create a governance dependency

Storing policies in S3 makes authorization rules easy to update, but it also creates a new source of truth that can be modified, read, or mis-scoped independently of the application. The article’s model relies on version-controlled policies scanned and loaded at startup, which is operationally clean but governance-sensitive. If the bucket permissions are too broad, the policy store itself becomes an overexposed trust anchor. If the policy set is not tightly managed, you can end up with authorization drift where the deployed policy no longer matches the intended access model.

Practical implication: Apply least-privilege access to the policy bucket and treat policy changes as governed identity changes, not simple file uploads.


NHI Mgmt Group analysis

Externalised authorization does not remove the identity boundary, it relocates it. Once policy moves out of application code, the security problem shifts to who can invoke the decision service, who can alter the policy source, and what trust exists between those two points. That makes the authorization plane a governed identity surface in its own right. Practitioners should stop treating policy-as-code as an abstraction that reduces IAM complexity; it changes where the complexity sits.

API Gateway is not just an integration layer, it is the enforcement perimeter for the PDP. If the caller can reach the authorization endpoint without strong authentication and scoped authorisation, the policy engine is exposed to untrusted decision requests. That is an access-control failure, not just an architecture choice. The implication is that serverless authorization must be secured as a service boundary, with request authentication and network restriction designed before policy logic is trusted.

S3-hosted policies create policy integrity debt when bucket governance is weaker than application governance. The article’s storage model makes policy updates simple, but every simplification in change control increases the importance of access control over the policy store itself. If policy writes are not tightly governed, the effective authorization model can drift without a code deploy. Practitioners should treat the policy repository as a high-value identity asset, not as static configuration.

Policy-as-code only works when policy distribution, decision access, and auditability are all governed together. The article shows how serverless deployment, tracing, and CloudWatch logging can support this model, but the operational burden does not disappear. Decision logs, policy versioning, and endpoint restrictions all have to line up. The practical conclusion is that authorization governance now spans runtime, storage, and caller identity rather than living only in the application layer.

What this signals

Authorization boundaries now behave like identity infrastructure. Once a PDP is deployed as a service, the real governance question is not whether the policy is correct, but whether the caller, transport, and policy store are all operating inside an enforced trust boundary. That shifts authorization from a code concern to an IAM and NHI governance concern.

Serverless teams should expect policy distribution, endpoint hardening, and audit logging to be reviewed together rather than as separate implementation tasks. If any one of those layers is weaker than the others, the authorization model becomes harder to trust even when the policy language itself is sound.


For practitioners

  • Harden the PDP request path Require signed caller authentication for every request to the authorization service, and restrict access with IAM authorizers, JWT validation, or mTLS where appropriate.
  • Separate policy storage from application trust Lock down the S3 policy bucket with least privilege, version control policy files, and review who can write or replace policy objects.
  • Audit policy-decision logging Send authorization decisions to a central log sink and verify that logs capture the request context needed to explain allow and deny outcomes.
  • Test policy changes outside the application release cycle Deploy policies independently from code, but require controlled promotion and regression testing so policy drift does not silently change access.

Key takeaways

  • Externalised authorization simplifies policy management, but it does not eliminate the need to secure the decision path, policy source, and caller identity.
  • In a serverless model, API Gateway and S3 become part of the authorization trust boundary, so weak controls there can undermine the whole design.
  • Practitioners should govern policy-as-code as an identity control surface, with tight access, version discipline, and auditable decision logging.

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, NIST CSF 2.0 and NIST Zero Trust (SP 800-207) set the governance and control requirements practitioners need to meet.

FrameworkControl / ReferenceRelevance
OWASP Non-Human Identity Top 10NHI-05 — Overprivileged NHIThe article depends on tightly scoped service and storage access around the PDP and policy bucket.
Recommendation — Audit service and storage permissions for overbroad NHI access and reduce them to the minimum needed.
NIST SP 800-53 Rev 5IA-9 — Service Identification and AuthenticationThe PDP is a service that must authenticate callers before making authorization decisions.
Recommendation — Apply IA-9 to ensure only authenticated services can invoke the policy decision point.
NIST CSF 2.0PR.AA-05 — Access Permissions, Entitlements and AuthorizationsThe piece is about governing access decisions, endpoint reachability, and policy change rights.
Recommendation — Review and restrict entitlements for the PDP, API Gateway, and policy repository under PR.AA-05.
NIST Zero Trust (SP 800-207)4 — Policy EnforcementAPI Gateway and the PDP together act as a policy enforcement boundary in a zero trust design.
Recommendation — Place the authorization service behind explicit policy enforcement and verify every caller before access.

Key terms

  • Policy decision point: A policy decision point evaluates contextual rules and returns an access decision that enforcement points can act on. It separates authorization logic from application code, which helps teams manage tenant rules, resource ownership, and risk signals consistently.
  • Policy as Code: Policy as code stores authorization logic in version control and evaluates it through testable, reviewable rules. For agent governance, it makes runtime decisions reproducible and measurable, which is critical when actions can be triggered by untrusted content and executed at machine speed.
  • Authorization Boundary: The authorization boundary is the defined scope of systems, identities, and dependencies that must satisfy a compliance programme. In FedRAMP, it determines what the assessor evaluates and what must be documented as external, so boundary accuracy is a control decision, not a paperwork exercise.
  • Policy Drift Detection: Policy drift detection is the process of identifying when an access policy no longer matches the intended rule or the current business context. It helps teams catch unauthorized changes, stale permissions, and exceptions that have quietly become the new normal, so governance stays aligned with actual identity and app usage.

Deepen your knowledge

NHI governance, agentic AI identity, and machine identity lifecycle are core topics in our NHI Foundation Level course, the industry's only accredited NHI security programme. If you are building or maturing an IAM programme, it is worth exploring.
NHIMG Editorial Note
Published by the NHIMG editorial team on June 11, 2026.
Updated on October 6, 2026.
NHI Mgmt Group, the independent authority on Non-Human Identity, IAM, and Agentic AI security. nhimg.org