← Back to Pull requests

Document how to prevent Feature Flags response tampering with response signing #42063

Open
unknown opened this pull request with 597 lines diff across 7 files
View on GitHub
unknown unknown commented on Nov 21, 2026 15:02 UTC
Author

<!-- Note: Please remember to review the Datadog Documentation Contribution Guidelines if you have not yet done so. -->

What does this PR do? What is the motivation?

Motivation

Client applications receive flag assignments over the network. Security reviewers, engineers, and search and AI tools look for this topic as "response tampering" and "origin attestation". They need one page that states the problem, the threats, the protection that response signing gives, and its limits. Each SDK page needs the option that turns signing on.

Changes

  • Add a solution guide, feature_flags/guide/prevent_response_tampering. It states the problem (response tampering and origin attestation) and gives a summary, key terms, a threat and protection table, the trust model, the request and verification flow, certificate rotation, an enablement table for each SDK, verification failures with a reason-code table, signature expiry, limits, and an FAQ with question headings.

  • Add a "Verify flag responses with response signing" section to the iOS, Android, and JavaScript client pages. Each section shows the experimental option (experimentalResponseSigning), the expireVerifiedFlags option, the modes, how to confirm that signing works, verification failures with the platform error types, and signature expiry.

  • Link the guide from the Guides index, the Client SDKs index, and the Proxy Feature Flag SDK Traffic guide. The proxy guide says that response signing does not support proxies.
  • Decisions

  • The page is a guide, not a concept page, because it is organized around a problem and its solution. The title, URL, description, and search tags use the terms "response tampering" and "origin attestation".

  • The page starts with a short summary and a threat table, so that readers and AI tools can find the answer without reading the full page. The FAQ uses question headings that match common search queries.

  • The feature is in Preview, and the SDK option is experimental. Each new page or section starts with a Preview callout that says so and links to Datadog Support. At GA, remove the callouts. No other text depends on them.

  • Signature expiry: by default, the SDK keeps serving the last verified flags and reports a stale state. expireVerifiedFlags returns default values instead. The pages warn that a network attacker who blocks refreshes can keep the last verified values.

  • The pages state which request data the signature covers: request content (method, host, path, query, body), client identity (hashes of the client token and the Authorization header), the request headers that the SDK lists in x-datadog-feature-flags-signed-headers, and the response headers that Datadog lists in x-datadog-feature-flags-signed-response-headers. Request headers that are not listed cannot change a signed response.

  • Response signing does not support a flag proxy or a custom flag endpoint. A network proxy that forwards traffic without change does not affect verification. The pages say so.

  • The guide has one table of reason codes, which all three SDKs share. Each SDK page shows how the platform reports them: PROVIDER_ERROR messages in the browser, FlagsResponseSigningException and ResponseSigningFailureReason on Android, and FlagsError.responseSigningFailed(reason:) on iOS. The draft revocation reason is not documented.

  • The SDK setup content is a section on each existing client page, to match the opt-out and configuration sections there.

  • The flow is a numbered list. The docs site has no Mermaid shortcode.

  • The pages do not include certificate identifiers, OIDs, or rotation details beyond "short-lived, rotated automatically every day".
  • Open placeholders

    These facts are not known yet. Each one has a TODO HTML comment in the page:

  • The first release version of each SDK with response signing (X.Y.Z on the JavaScript, Android, and iOS pages).

  • The list of Datadog sites that support response signing (guide FAQ).
  • Merge readiness

  • Ready for merge
  • AI assistance

    Claude Code drafted the pages from the SDK pull requests and the existing Feature Flags docs. A human reviews all content.

    For Datadog employees:

  • ⚠️ Your branch name MUST follow the <name>/<description> convention and include the forward slash (/). If you've already created your PR with an incorrect branch name, please rename your branch and open a fresh PR.

  • 🤖 New: Comment with /review to run an automated check that catches common issues before a Documentation team member reviews your PR.
  • Additional notes

    Do not merge until the SDK releases with response signing are public and the TODO: confirm comments are resolved.

    Diff: 597 lines (+447 / -150) across 7 files Reviewer: joepeeples Review duration: 13014m
    All Vouch review confidence checks passed
    Residual risk 0.27 = Change Risk (0.50) × (1 − Review Confidence (0.47)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.50 · 597 lines diff across 7 files
    0.50
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.02 · 1 substantive comment(s)
    0.02
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    46%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.383
    Shallow Review Depth shallow_review_depth
    0.344
    Real PR Conversation Timeline
    1 comments
    "Review active on #42063"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 46.7% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 50% (MEDIUM) · Higher = larger blast radius
    50%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 46.7% · Lower = rushed or shallow review
    46.7%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 26.7% · Safe to merge
    26.7%