Require penetration tests when trust boundaries change

Gate releases on changes to trust-boundary enforcement, and record permission to test separately from acceptance of release risk.

OpenThunder Editorial · 2026-11-19

Imagine a team uses an AI coding tool to update tenant authorization in an invoice service without adding a public endpoint. Unchanged endpoints do not justify ordinary verification when authorization enforcement changes: Tenant A’s credentials must still never retrieve Tenant B’s invoices.

Gate release on a scoped penetration test when a change materially alters a trust boundary. AI authorship alone should neither trigger nor waive that requirement.

Material boundary changes need penetration testing

A code review assesses whether an implementation appears consistent with its intended design. Adversarial testing asks whether an attacker can violate that design through reachable behavior. Neither substitutes for the other.

Treat a change as material when it creates or broadens a path across a protected boundary, or changes the mechanism enforcing that boundary. Assess public exposure, authentication, authorization, and sensitive-data access. Intended permissions can remain unchanged while their enforcement changes materially.

For example, renaming an authorization helper without changing its predicates, callers, inputs, or execution order can be behavior-preserving. Moving a tenant check from a shared enforcement point into individual handlers changes enforcement logic, even if the intended access rules stay identical. The distinction needs evidence: a reviewed diff tracing enforcement paths, relevant regression results, and negative access tests. A refactor label is not evidence.

When review cannot substantiate that the boundary is unchanged, use the penetration-test gate. “Low risk” alone is not an exemption.

That choice consumes testing time and operator capacity. Keep the assessment focused on the changed boundary rather than turning every qualifying change into an environment-wide exercise. Ordinary verification remains appropriate for a substantiated behavior-preserving refactor.

For this policy, scoped adversarial testing means deliberate attempts to violate stated security rules within approved limits. A penetration test is an investigative assessment of reachable attack paths and control failures, rather than only a fixed set of negative checks. Its scope can be narrow. Testing tenant isolation does not require permission to probe the entire environment.

Use a boundary-change release check

Use this matrix to choose the assessment, then attach the record below to the release.

Change Testing decision Required evidence and approval limit
Internal refactor Ordinary verification can suffice when review substantiates unchanged behavior and boundaries. Otherwise, escalate to a scoped penetration test. Reviewed diff, relevant regression results, and a documented no-boundary-change assessment. Approval covers this refactor, not unrelated service risks.
New public endpoint Use a scoped penetration test when the endpoint materially expands reachability or access. A narrower assessment needs a documented nonmaterial-boundary judgment. Endpoint and dependency scope, tested build and configuration, findings, retests, and accepted residual risk. Approval covers only the assessed exposure and configuration.
Tenant-authorization change Use a targeted penetration test of cross-tenant access when permissions or their enforcement change. Tenant-access rules, negative access tests, adversarial results, and finding dispositions. Passing results support only the tested paths and roles.

A public endpoint without sensitive actions is not automatically exempt: assess its reachability and dependencies. Conversely, an internal service with broad access to sensitive data can warrant penetration testing without direct internet exposure.

Attach an evidence-and-approval record

A test report is evidence, not release authority.

The security owner authorizes execution; the release approver decides whether the evidence and remaining risk justify shipping. One person can hold multiple responsibilities, but record the decisions separately. A clean summary without scope and coverage information contributes little to that decision.

Bound automated testing before it starts

For an AI-orchestrated exercise, approve concrete execution controls:

Approve scope, methods, timing, and stop conditions before execution. Check that the operator can actually constrain and interrupt the tool. Written scope alone is insufficient.

Related reading: Cloudflare’s Adapting to AI penetration testing orchestrators: The Modern Security Model.

Test the invoice rule, then account for production differences

For the opening invoice-service scenario, the intended rule is that a tenant administrator can view invoices belonging to that administrator’s tenant, but never another tenant’s invoices.

The team creates two designated staging tenants, A and B, with synthetic invoices. The security owner authorizes testing only against those tenants and the candidate build. Production accounts, real invoices, external integrations, and destructive actions are outside scope.

Before execution, engineering writes the expected access rules:

Identity and requested resource Expected result
Tenant A administrator requests a Tenant A invoice Allow
Tenant A administrator requests a Tenant B invoice Deny
Tenant A user without invoice permission requests a Tenant A invoice Deny
Unauthenticated request for either tenant’s invoice Deny

These rules provide a reference for review, automated negative tests, and the penetration test. They also expose ambiguity before testing turns it into a finding. The test should investigate whether reachable behavior can defeat the rules, not merely repeat the four listed requests.

If testing retrieves a Tenant B invoice through Tenant A credentials, stop the exercise, preserve the minimum evidence needed, and route the finding to the service owner. Do not continue exploring other systems to establish a larger impact.

The owner fixes the issue and supplies retest evidence. Every finding must be resolved or explicitly dispositioned under the organization’s risk-acceptance rules. A disposition identifies the affected boundary, rationale, compensating controls where applicable, accountable risk owner, and review deadline. An open tenant-isolation failure should block this release.

A clean result means the tested attempts did not violate the stated rules on that staging build. It cannot prove production-wide isolation across every route, role, configuration, background job, or future change.

Before approving release, account for relevant differences between staging and production configuration. If an unresolved difference could affect tenant enforcement, hold release until review substantiates that the tested evidence applies or additional authorized testing addresses the gap. Do not treat an unexplained difference as covered by a passing result.

Try the check on one pending change

In five minutes, fill in four fields: changed boundary, test authorizer, remediation owner, and release approver. Then write one sentence stating what a passing test would not establish, including any relevant production difference.

Use the gaps to identify the next review or authorization needed. This exercise reveals missing ownership and evidence; it does not replace the technical assessment.