Introducing a new way to review your PRs.

Read the announcement

raroque / vibe-security-skill

Agent skill that audits vibe-coded apps for common security vulnerabilities introduced by AI coding assistants

View on GitHub

15 documents · Updated Oct 30, 2026

docs / external-integration-security

External integration security guidance

External integrations connect product features to payment providers, mobile platforms, and AI services. They also create trust boundaries where client input, provider messages, secrets, and paid resources meet. This guidance keeps those boundaries controlled by treating clients and external responses as untrusted, keeping private credentials on trusted servers, and limiting the cost and effect of each request.

Integration trust boundaries

An integration trust boundary separates the product from a client environment or an external provider. The product must verify data when it enters the boundary and must limit what can leave it. This prevents a browser, mobile app, webhook sender, or model from choosing prices, identities, permissions, or actions that belong to the server.

The security review should trace both directions of the exchange:

  • Client to product: Treat request fields, deep-link values, and client flags as attacker-controlled.
  • Product to provider: Send only the data and permissions needed for the requested feature.
  • Provider to product: Verify signatures where the provider supports them, then validate the event before changing state.
  • Product to client: Return only data the client needs. Never return private keys or trusted internal state that the client can reuse.

The following child pages cover the main integration groups:

Integration groupSecurity focusGuidance
PaymentsServer-owned prices, verified provider events, and current subscription statePayment security
Mobile clientsSecret-free app bundles, protected tokens, and safe deep linksMobile security
AI servicesPrivate provider keys, usage limits, prompt boundaries, and safe model outputAI integration security

Server-side ownership

The server owns values that affect money, access, identity, or provider cost. A client can request an operation, but it cannot decide the price, role, subscription state, usage allowance, or provider credential used to perform it.

Keep provider secrets out of source code and client bundles. Values placed in browser or mobile configuration are visible to the user of that client. Use a server-side path for calls that need a secret key. Store only the minimum client-safe configuration in the client.

This boundary also applies to mobile and AI features. The mobile app calls the product server, and the product server calls the provider. AI requests use the same path so users cannot extract a provider key or bypass application limits.

Provider event handling

Provider events can update important product state, such as a payment or subscription. The product must confirm that an event came from the provider before it changes that state. It must also use the verified event data to find the related account instead of trusting user data supplied in an unverified request.

When a provider supports signed events, preserve the original request body for signature verification. After verification, validate the event type and its expected fields. Keep the product database as the source of truth for access decisions, and refresh that state from trusted provider events.

Request and output controls

Every integration needs limits on what it accepts, what it can do, and how often it can run. Validate input against an allowlist or schema before it reaches a provider or a sensitive action. Apply limits by both user and network source so that account creation or address rotation does not remove the control.

Model output and other provider responses are data, not instructions. Sanitize text before rendering it as HTML. Validate any returned action parameters against a narrow schema and allowlist before execution. Give tools the least access needed, prefer read-only access, and record actions that can change data or spend money.

The request path below shows the shared control points for a client-to-provider feature. It keeps the client outside the trust boundary for secrets, business rules, and privileged actions.

flowchart LR
    C[Client or app] --> V[Validate identity and input]
    V --> L[Apply user and network limits]
    L --> S[Server-side business rules]
    S --> P[External provider]
    P --> E[Verify and validate provider response]
    E --> D[Update product state]
    D --> C

Integration review sequence

A review starts with the data and authority that cross each boundary. It then checks that the product can reject false events, excessive use, and unsafe output before those inputs affect users or systems.

  1. Identify each client, provider, webhook, deep link, and privileged tool.
  2. Mark secrets, personal data, payment data, identity data, and provider responses that cross the boundary.
  3. Confirm that the server owns prices, permissions, account links, subscription state, and usage limits.
  4. Confirm that client calls and provider events have authentication or signature checks.
  5. Confirm that input and provider output use validation before storage, rendering, or action.
  6. Confirm that limits and alerts protect provider spend and resource use.
  7. Confirm that the product can revoke or rotate credentials without shipping a new client.

Cross-integration controls

Some controls apply to every external integration because they protect the shared boundary rather than one provider type.

ControlExpected result
Secret placementPrivate keys stay on the server and are not committed to source or bundled into clients.
Authority checksThe server decides identity, access, price, plan, and quota.
Input validationRequests, callback values, deep-link parameters, and provider output match an allowed shape.
Event authenticitySigned provider events are checked before they change product state.
Usage protectionPer-user limits, network limits, provider caps, and billing alerts reduce abuse and cost.
Output safetyExternal text and action parameters are treated as untrusted until checked.
Credential recoverySecret rotation and client credential revocation do not depend on trusting the client.

Change checklist

When these files or sections are changed, remember to consider these:

  • When a new provider call is added, confirm that its secret stays server-side and that its client entry point has identity and usage checks.
  • When a webhook or callback changes, preserve the raw body and keep signature verification before state changes.
  • When a mobile or browser configuration value changes, classify it as public or private before exposing it to the client bundle.
  • When a payment or subscription rule changes, keep the server-side provider record as the source for price and access decisions.
  • When an AI tool or output path changes, review its allowlist, parameter validation, privilege, and rendering boundary together.
  • When a provider or credential changes, confirm that rotation, spend limits, alerts, and failure behavior still work without a client update.

Important failure modes

TriggerConsequenceGuard
A client supplies a price, plan, role, or subscription flagAn attacker gets a cheaper purchase or unauthorized accessResolve the value on the server and check current provider state.
A secret enters a browser or mobile bundleAnyone can use the provider account or spend against itKeep the call behind a server proxy and rotate exposed keys.
An unsigned or unverified provider event changes stateAn attacker can grant access or attach activity to another accountVerify the provider signature and validate the event before updating state.
A deep link or callback performs an action from raw parametersAnother app or site can trigger an unsafe actionValidate parameters and require confirmation for destructive actions.
A model response renders as trusted content or calls a tool without checksThe response can cause script execution or an unauthorized data changeSanitize output and validate tool calls against a least-privilege allowlist.
An expensive integration has no server-side quotaOne user or bot can exhaust provider or cloud spendCombine per-user and per-network limits with hard provider caps and alerts.

Key files

FileWhy to read it
vibe-security/SKILL.mdDefines the overall review principle and places external integrations in the security audit sequence.
vibe-security/…/payments.mdExplains the server-owned payment values, signed webhook flow, and subscription source of truth.
vibe-security/…/mobile.mdExplains the client-bundle, token-storage, deep-link, and biometric trust boundaries.
vibe-security/…/ai-integration.mdExplains provider-key protection, spend limits, prompt injection, output handling, and tool controls.
vibe-security/…/secrets-and-env.mdDefines which configuration may be public and which credentials must remain private.
vibe-security/…/rate-limiting.mdDefines the abuse and spend controls for provider-backed endpoints.