Putting a real-time AI avatar inside an iframe is not equivalent to giving the iframe unrestricted camera access. Browser permission prompts, origin-scoped delegation and runtime revocation form separate security boundaries. This runbook defines acceptance tests for teams embedding video experiences into a separate host application.

Draw the trust boundary before granting media features

Begin with a diagram of the top-level social page, the embedded video application, the media-capture permission, the transport endpoint and any analytics script. The parent origin and iframe origin are not interchangeable. If a user grants camera access in one context, engineers must not assume that every third-party component deserves the same capability. Document which origin may request camera and microphone, and why. The W3C Permissions Policy specification, updated in 2026, includes examples of delegating media features to selected frame origins. Treat the allowlist as the boundary of an explicit product feature, not a wildcard shortcut. Review redirect destinations: a frame initially served from an expected origin can redirect to another origin that should not inherit capture privileges. Include browser version, iframe source, parent headers and device permission state in every test record.

Combine header rules with the iframe allow attribute

A parent response may set a Permissions-Policy header that constrains available features; the iframe allow attribute further restricts those capabilities for a particular embedded document. The MDN iframe allow reference explains that the attribute is an additional restriction rather than a replacement for the header. Build a four-row test matrix: policy permits and iframe permits; policy denies but iframe permits; policy permits but iframe denies; both deny. In the latter three configurations, camera capture should not unexpectedly succeed. Avoid a universal wildcard camera and microphone delegation as a quick fix. Instead, enumerate approved origins and test them separately for development, staging and production. When the embedded application needs both tracks, verify that refusal of microphone permission does not silently force an unexplained camera state. Report browser-specific behavior rather than pretending every implementation surfaces an identical error string.

Test permission prompts and clear user intent

The user should start a call through an explicit action. Opening a profile card, scrolling a feed or receiving a text message must not activate capture. Instrument the media-request transition: click event, origin requesting getUserMedia, prompt shown, track-ready event and visible in-call indicator. Keep these events separate from raw audio and video content: operational measurements do not require recording the conversation. On a denied prompt, show a text alternative and instructions to open browser settings. On the next attempt, do not spam permission requests in a loop. Recheck state when moving from mobile browser to a standalone web app because session and permission behavior differ. A useful acceptance test uses a clean browser profile, an already-granted profile and a previously denied profile. Each should produce a comprehensible outcome without hidden capture or an unexplained blank screen. Retest after browser updates.

Make stop and revoke mean something operational

A person tapping End should see active microphone and camera tracks stop, their status indicators disappear and the network sender cease using capture. Ending the UI animation is not enough: inspect track readyState and the media sender state in developer tools. Test a second exit path through the browser Back button and a third through parent-page navigation. When a parent removes an iframe, ensure that the old capture context terminates rather than leaving a detached session occupying the device. Then test operating-system permission revocation during a call: the embedded application needs a visible failure path to text or a paused screen. Logging only media device failed hides whether consent was withdrawn, a device disappeared or transport was interrupted. Store minimal event codes and provide a user-facing error message that avoids claiming the site can repair an OS permission automatically.

Check cross-origin messaging without leaking content

Embedded experiences often use postMessage to tell the parent page a call started or ended. Never trust arbitrary messages just because they contain a familiar action name. Validate event.origin and the sender window; treat payloads as untrusted structured data with a small schema and version. A parent should not accept an endCall, shareTranscript or chargeUser message from an advertising frame. Likewise, the iframe must not broadcast private conversation text to every origin because it is convenient. Create negative tests in which a second iframe imitates legitimate events, sends an unknown field and replays a previously valid completion message. Verify that only expected transitions occur. For billing or public posting, use server-side authorization rather than a browser message as proof of user consent. Keep raw transcript content out of cross-frame telemetry unless a specific feature and its privacy terms justify it.

Gate deployment on a reproducible browser record

A release decision needs a table of test conditions, not a screenshot of a working video call. Run the permission matrix on representative desktop and mobile browsers, including a phone switching between foreground and background. Capture HTTP headers, effective iframe attributes, whether capture succeeded, permission indicators, denial UX and cleanup result. Mark unsupported browser combinations as unsupported rather than counting them as passed. Fail the release if an unauthorized origin can activate media, a stopped session continues recording, a spoofed cross-origin event controls billing or denied users have no usable text fallback. Review the matrix after changing a hosting domain or adding an embed partner. This design lets engineering teams extend accessible real-time AI video without turning a single embedded component into an unrestricted camera gateway. Hold a regression review when browser policy or origin routing changes.

Sources