> For the complete documentation index, see [llms.txt](https://docs.facephi.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.facephi.com/docs.facephi-en/products/suite-iad-injection-attack-detection/manual-producto-iad.md).

# IAD Product Manual

### 1. Overview <a href="#id-1-visin-general" id="id-1-visin-general"></a>

Facephi IAD (*Injection Attack Detection*) is the solution that protects facial biometric verification processes against attacks that insert fraudulent digital data into the capture flow, bypassing the device's physical camera. Unlike traditional presentation attacks (where an impostor shows a photo or mask to the camera), injection attacks operate **behind** the sensor, replacing or manipulating the stream before it reaches the biometric service.

IAD is designed to detect signals consistent with injection attacks by assessing whether the capture:

* Comes from the device's physical camera and not from a virtual or intermediate source.
* Shows no signs of manipulation by intermediate software (hooking, virtual cameras, injected scripts).
* Shows no signs of an untrusted environment (emulator, rooted device, browser with malicious extensions).
* Contains no artifacts consistent with synthetic, replayed, or reproduced content.

### 2. Why IAD is necessary <a href="#id-2-por-qu-iad-es-necesario" id="id-2-por-qu-iad-es-necesario"></a>

The widespread adoption of facial biometrics has driven attackers to abandon physical attacks (increasingly detectable by Passive Liveness) and shift to digital techniques: virtual cameras that play prerecorded videos, manipulation of the client application, or direct injection of payloads into the network. These techniques are stealthy because from the server's perspective, "everything looks normal": a camera opened, a face was captured, a match was made.

Without a dedicated IAD layer, a biometric system well designed to defend against presentation attacks remains vulnerable to this vector. IAD is the layer that closes this gap.

### 3. IAD and Passive Liveness: complementary layers <a href="#id-3-iad-y-liveness-pasivo-capas-complementarias" id="id-3-iad-y-liveness-pasivo-capas-complementarias"></a>

IAD is often confused with Liveness, but they answer different questions, and both are needed:

| Question                                                 | Layer that answers it      | What it detects                                                                   |
| -------------------------------------------------------- | -------------------------- | --------------------------------------------------------------------------------- |
| Is there a person in front of the camera?                | **PAD / Passive Liveness** | Printed photos, masks, videos played on a screen in front of the camera, cutouts  |
| Did the capture actually come from this device's camera? | **IAD**                    | Virtual cameras, injected deepfakes, client manipulation, emulators, MITM, replay |

Passive Liveness (PAD) and IAD answer different but complementary questions. PAD assesses whether a real, live person is in front of the camera; IAD assesses whether the capture arrived through a legitimate channel and was not injected or manipulated before reaching the service. They are different layers of defense: PAD analyzes the image content, while IAD analyzes the origin and integrity of the delivery channel (metadata, camera fingerprint, execution environment). That is why they are recommended together: they cover attack vectors that the other, by design, is not intended to address.

**Architecture recommendation**: enable IAD + Passive Liveness in all authentication and Onboarding flows with medium or higher security requirements.

### 4. Types of attacks covered by IAD <a href="#id-4-tipos-de-ataque-que-iad-cubre" id="id-4-tipos-de-ataque-que-iad-cubre"></a>

Attacks against facial biometric verification operate on two complementary planes, which require different layers of defense. On the presentation plane, detection aligns with the taxonomy of international standards such as ISO/IEC 30107-3 (Presentation Attack Detection). The injection plane corresponds to a more recent family of threats, for which international standardization is still under development and which IAD specifically addresses.

| Plane        | Family           | Attack method                                                                   | Layer that addresses it             |
| ------------ | ---------------- | ------------------------------------------------------------------------------- | ----------------------------------- |
| Presentation | Physical content | Presenting a printed photo, a screen replay, or a mask to the camera            | Passive Liveness (PAD)              |
| Injection    | Virtual camera   | Using a synthetic camera instead of the physical camera                         | IAD                                 |
| Injection    | External device  | Using an external device to capture and transmit video as if it were the camera | IAD                                 |
| Injection    | Browser          | Manipulating camera calls or code in web flows                                  | IAD                                 |
| Injection    | Network          | Manipulating or replacing the payload in transit between client and server      | IAD + integration layer (section 8) |

**Detected by IAD analysis:**

* **Virtual cameras:** use of a synthetic camera instead of the device’s physical camera.
* **External capture devices:** an external device that captures and transmits video while presenting itself as a legitimate camera.
* **Browser attacks:** manipulation of camera calls or code in web flows.

Injected content can range from a stolen still image to live AI-generated deepfakes,\
including facial morphs, GAN-generated synthetic faces, and cheap\
fakes (3D renders or manipulated images).

The following threats are detected in part by IAD, but cannot be addressed through its analysis alone: they also require the session-binding practices, secure transport, and retry policies described in section 8 (Integrator Responsibilities).

* **Network attacks:** manipulation or transmission of payloads in transit between client and server. Effective mitigation depends on session signing and co-origin verification in the integrator’s backend.
* **Man-in-the-Middle:** interception and substitution of the payload between client and server. Mitigated with TLS and certificate pinning.
* **Replay attacks:** reuse of previously valid captures. Replay mitigation is an evolving capability; it is strengthened with tokenization, TTL, and per-session retry limits.

**Coverage considerations:**

* The effective coverage of each family depends on the platform and the security mode configured for the tenant.
* When signals are ambiguous, IAD prioritizes security: it may classify a presentation attack as an injection attack. This is a conservative and intentional classification: blocking the attack takes precedence over labeling it accurately

### 5. Product architecture

IAD consists of two layers that operate in coordination:

#### 5.1. Client layer: Selphi IAD Component <a href="#id-51-capa-cliente-selphi-iad-component" id="id-51-capa-cliente-selphi-iad-component"></a>

Selphi IAD SDK for facial biometric capture, incorporating the new IAD component. Functionally equivalent in terms of flow and integration, it includes additional anti-fraud controls during capture:

* Internal camera and permission management, prioritizing native hardware.
* Collection of capture metadata and runtime environment signals.
* **Security Checks**: detection of untrusted environments without access to the user’s personal information.
* **Passive image analysis**: evaluation of the image’s statistical, geometric, and temporal characteristics to identify patterns consistent with video playback, frame injection, artificial rescaling, or synthetic sources, as opposed to real captures from a physical sensor. The analysis is performed without reconstructing the image or extracting biometric information.
* Generation of an **IAD bundle**: encrypted package containing images and metadata, prepared for server-side validation.

Platforms currently supported: **Android, iOS, Hybrid Plugins, Web**

Device requirements (Android; equivalent requirements for iOS, to be validated with the Facephi team):

* Minimum 3 GB of RAM.
* Front-facing camera with a preview resolution of 1920×1080 or higher.

The capture result (`SelphiResult`) includes, in addition to the standard biometric fields (`templateRaw`, `template`, `bestImage`, `bestImageTokenized`, `livenessDiagnostic`), the field `iad` which contains the anti-fraud analysis information, ready to be sent to the verification service.

#### 5.2. Server layer: IAD Service <a href="#id-52-capa-servidor-iad-service" id="id-52-capa-servidor-iad-service"></a>

Stateless REST microservice that receives the IAD bundle and returns a binary verdict:

* **Bona-fide capture (1):** the capture is legitimate.
* **Injection detected (0):** signals consistent with an injection attack have been identified.

The service can be deployed in two modes:

* **SaaS (recommended):** deployment managed by Facephi, with continuous updates to the model and threat signatures. This is the preferred model because it ensures detection keeps pace with new threats without requiring customer intervention.
* **On-premises:** deployment on the customer's infrastructure for environments with specific regulatory or network isolation requirements.

### 6. IAD API <a href="#id-6-api-de-iad" id="id-6-api-de-iad"></a>

The API surface exposed to the integrator depends on the deployment model. The two modes are functionally equivalent in terms of attack detection, but differ in their API contracts.

#### 6.1. SaaS: Identity API <a href="#id-61-saas-identity-api" id="id-61-saas-identity-api"></a>

In a SaaS deployment, IAD is invoked through the `POST /iad` endpoint of the Identity API. The full reference, error codes, and integration examples are published at:

`docs.facephi.com/api-rest/identity-api/identity-api-reference/security-compliance/injection-attack-detection`

Contract summary:

| Element        | Value                                                                             |
| -------------- | --------------------------------------------------------------------------------- |
| Endpoint       | `POST {IDENTITY_API_BASE_URL}/iad`                                                |
| Authentication | Header `x-api-key`                                                                |
| Content-Type   | `application/octet-stream`                                                        |
| Body           | `IAD_BUNDLE` (binary): encrypted package generated by the Selphi Antispoof Widget |

Response `200`:

```json
{  "attack": true}
```

Where `attack: true` indicates that an attack has been detected, and `attack: false` indicates a legitimate (bona fide) capture.

The full list of codes is available in the Identity API reference linked above.

**SaaS integration flow**

1. The client integrates the Selphi IAD SDK (Selphi IAD antispoof component) and captures the `onExtractionFinished`.
2. event. From the extraction result, the `encryptedLivenessRaw`property is retrieved; it contains the encrypted bundle.
3. The client application sends this bundle to the **integrator's backend** (not directly to the IAD endpoint).
4. The integrator's backend invokes `POST /iad` on the Identity API, providing the API key and the bundle in the body.
5. The `{"attack": true|false}` response determines the flow decision.

Example:

{% code title="" overflow="wrap" expandable="true" %}

```
const onExtractionFinished = (extractionResult) => {
  fetch(YOUR_BACKEND_URL, {
    method: 'POST',
    headers: { 'Content-Type': 'application/octet-stream' },
    body: extractionResult.detail.encryptedLivenessRaw
  })
  .then(response => response.json())
  .then(result => console.log('RESULT FROM SERVICE', result));
}
```

{% endcode %}

#### 6.2. On-premises: IAD Service <a href="#id-62-on-premise-iad-service" id="id-62-on-premise-iad-service"></a>

In an on-premises deployment, the integrator operates the IAD Service microservice directly. The published endpoints are:

| Endpoint                        | Method | Purpose                                                                                       |
| ------------------------------- | ------ | --------------------------------------------------------------------------------------------- |
| `/api/v1/iad/liveness/evaluate` | POST   | Verifies the IAD bundle and determines whether the capture is legitimate or has been injected |
| `/api/v1/iad/extract`           | POST   | Extracts the validated image from the payload (optional, depending on the integrator's flow)  |
| `/api/v1/iad/version`           | GET    | Returns the service version and license status                                                |
| `/api/v1/iad/health`            | GET    | Health check for monitoring                                                                   |

> Delivery of the On-premises option is subject to approval by a sales representative.

The complete request/response schema and operational deployment guide are provided with the on-premises license.

**Example: liveness/evaluate (on-premises)**

Request:

{% code title="" overflow="wrap" expandable="true" %}

```
POST /api/v1/iad/liveness/evaluate
Content-Type: multipart/form-data

capture=@iad_bundle.bin
```

{% endcode %}

Response (legitimate capture):

{% code title="" overflow="wrap" expandable="true" %}

```
{
  "diagnostic": "Live",
  "reason": "None",
  "probability": 1,
  "score": 1,
  "sdkDuration": 12,
  "queueDuration": 3
}
```

{% endcode %}

{% hint style="warning" %}
The multipart field is called `capture`. The old name `file` has not been accepted since version 2.0.0.
{% endhint %}

#### 6.3. Comparative summary <a href="#id-63-resumen-comparativo" id="id-63-resumen-comparativo"></a>

| Aspect                  | SaaS (Identity API)                                                                                            | On-premises (IAD Service)                                                            |
| ----------------------- | -------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------ |
| Main Endpoint           | `POST /iad`                                                                                                    | `POST /api/v1/iad/liveness/evaluate`                                                 |
| Authentication          | `x-api-key` header                                                                                             | License managed by the integrator                                                    |
| Content-Type            | `application/octet-stream`                                                                                     | `multipart/form-data`, with the field `capture`                                      |
| Response format         | `{ "attack": bool }`                                                                                           | `{ "diagnostic", "reason", "probability", "score", "sdkDuration", "queueDuration" }` |
| Additional Endpoints    | Managed by Facephi                                                                                             | `/extract`, `/version`, `/health`, `/config`                                         |
| Model updates           | Continuous, automatic                                                                                          | Via service versioning                                                               |
| Reference documentation | `docs.facephi.com/api-rest/identity-api/identity-api-reference/security-compliance/injection-attack-detection` | Provided with the license                                                            |

### 7. Integration: recommended flow <a href="#id-7-integracin-flujo-recomendado" id="id-7-integracin-flujo-recomendado"></a>

{% code title="" overflow="wrap" expandable="true" %}

```
[Client app]
    ↓ uses
[Selphi IAD Component]                      Face Capture + Security Checks + IAD bundle
    ↓ returns SelphiResult { templateRaw, bestImageTokenized, iad, ... }
    ↓ or the onExtractionFinished event with encryptedLivenessRaw (Web)
[Integrator backend]
    ↓ POST with bundle
[IAD API]                                   SaaS:  POST /iad
                                            On-prem: POST /api/v1/iad/liveness/evaluate
    ↓ returns verdict
[Integrator backend]
    ↓ if bona-fide, continue with:
[Passive Liveness Service]               Liveness validation
[Matching / Templates Service]          Identity Verification
```

{% endcode %}

Key flow points:

1. Capture is always performed with Selphi IAD (not the standard component). This ensures the bundle is generated correctly.
2. The bundle is sent from the **integrator backend** to the IAD API, not directly from the client. This is by design: Facephi's biometric services are B2B, stateless, and are invoked from the integrator's server side.
3. The decision to continue the flow if IAD detects injection is up to the integrator, within the framework of the security mode configured in the tenant.
4. IAD and liveness are independent calls. We recommend invoking IAD first as a preliminary filter.

### 8. Integrator responsibilities <a href="#id-8-responsabilidades-del-integrador" id="id-8-responsabilidades-del-integrador"></a>

Facephi's biometric services are stateless microservices: they apply atomic integrity controls per payload (tokenization, TTL, signature validation) but **do not correlate assets with one another**. This has implications that the integrator must manage in its orchestration layer.

#### 8.1. Session binding and asset co-origin <a href="#id-81-vinculacin-de-sesin-y-co-origen-de-assets" id="id-81-vinculacin-de-sesin-y-co-origen-de-assets"></a>

The integrator is responsible for ensuring that the different assets from the same operation (face capture, document capture, IAD bundle, liveness token, etc.) come from the same device and the same session. This is usually achieved by signing the payloads at capture time with a session key generated on the client, and verifying that signature in the integrator's backend before invoking the biometric services.

Without this binding, an attacker could combine a legitimate IAD bundle from one person with a liveness token from another (an attack known as *stream decoupling*). This cross-check is not performed by any individual Facephi biometric service, nor can it be, because each microservice only sees the asset sent to it.

This shared responsibility **is not a product gap**: it is standard practice for biometric integration in decoupled B2B architectures, equivalent to how any integrator signs and binds assets in distributed KYC flows.

#### 8.2. Retry policies <a href="#id-82-polticas-de-reintento" id="id-82-polticas-de-reintento"></a>

IAD applies controls per payload. If the integrator allows unlimited retries after a rejection, an attacker can use the feedback as an oracle to iteratively refine their payloads until one passes the controls. We recommend:

* Limit the number of retries per session (typically 3 to 5).
* Apply progressive throttling between retries.
* Do not expose the detailed reason for rejection to the client (a generic message is sufficient and reduces the oracle surface).
* Log and alert on anomalous retry patterns.

#### 8.3. Transport and storage <a href="#id-84-transporte-y-almacenamiento" id="id-84-transporte-y-almacenamiento"></a>

The IAD bundle is encrypted as it travels from the client component. The integrator is responsible for:

* Use TLS for all communications with the IAD Service.
* Apply certificate pinning in the mobile client to prevent MITM attacks on compromised devices.

### 9. Detection of untrusted environments (client layer) <a href="#id-9-deteccin-de-entornos-no-confiables-capa-cliente" id="id-9-deteccin-de-entornos-no-confiables-capa-cliente"></a>

Selphi IAD continuously evaluates the mobile device environment during capture and reports environment risk signals. Threat categories monitored during capture include, but are not limited to:

* **Device and system integrity:** root, unlocked bootloader, unofficial ROM, SDK library integrity, class loader tampering.
* **Debugging and instrumentation:** developer mode, debugger connected, ADB active, hooking frameworks, or dynamic instrumentation.
* **Emulation and virtualized environments:** execution in an emulator, network interfaces associated with virtualized environments, cloud emulators.
* **Sensor validation and physical interaction:** absence of expected physical sensors, inactivity of available sensors.
* **Application installation and usage context:** untrusted installation source, anomalous device profiles.
* **User security posture:** absence of a screen lock, active accessibility services.

Detected signals are evaluated according to the security mode configured in the integrator's tenant and added to the IAD bundle for consolidated analysis in the backend. The integrator does not need to manage these signals individually: the consolidated result is returned in the IAD Service response.

IAD provides detection of untrusted environments, but the specific signals that can be evaluated depend on the capabilities available on the platform and the component used. Device-specific detections, such as root, bootloader, ADB, or sensors, are capabilities specific to the mobile environment.

> For security reasons, Facephi does not publish the exhaustive list of specific checks applied by each control, as this information could be used by malicious actors to design evasion techniques.

### 10. Privacy and data <a href="#id-10-privacidad-y-datos" id="id-10-privacidad-y-datos"></a>

* The IAD Service is stateless. It does not persist captures or metadata beyond request processing.
* The SDK Security Checks evaluate the state of the device and system **without accessing the user's personal information**.
* Passive image analysis is performed without reconstructing the image or extracting additional biometric information.
* Detection models are trained using datasets for internal use and do not store end-user data.
* In SaaS deployments, communications are encrypted in transit; license and encryption keys are managed according to Facephi's standard practices.
* In on-premise deployments, the customer has full control over the infrastructure, network, and log storage.

### 11. Support and next steps <a href="#id-11-soporte-y-siguiente-paso" id="id-11-soporte-y-siguiente-paso"></a>

To obtain access, licenses, detailed technical specifications (full OpenAPI, performance metrics under NDA), or discuss a specific use case, contact your Facephi sales representative.

The integration documentation for the client component (Android, iOS, Web) is available at `docs.facephi.com/productos/suite-iad-injection-attack-detection`.

\ <br>
