> ## Documentation Index
> Fetch the complete documentation index at: https://doc.blueapi.ir/llms.txt
> Use this file to discover all available pages before exploring further.

# EMEP Security Testing and Verification

> Signature verification, tampered manifest, malicious model detection, and dependency CVE tests for EMEP security validation.

Security testing verifies that EMEP resists supply chain attacks, tampering, and malicious inputs. Tests cover artifact signing, manifest integrity, model behavior, and dependency vulnerabilities.

## Signature Verification Tests

Every artifact in ArtifactStore must carry a valid signature. The test suite verifies:

* Valid signature passes verification.
* Invalid signature (wrong key, wrong algorithm) fails verification.
* Missing signature fails verification when `require_signed_models` is true.
* Signature from a revoked key fails verification.
* Signature on a modified artifact fails verification.

See [Artifact Signing](/security/artifact-signing) for signing algorithms and key management.

## Tampered Manifest Tests

Model manifests describe architecture, weights, tokenizer, and dependencies. The test suite verifies:

* Manifest with mismatched weight checksum is rejected by ModelLoader.
* Manifest with altered architecture description is caught by ModelCompatibilityAnalyzer.
* Manifest with unknown dependency versions triggers a warning in license scanning.
* Manifest with missing required fields fails validation.

## Malicious Model Detection Tests

Malicious models may contain backdoors, data extraction triggers, or adversarial weights. The test suite includes:

* **Static analysis**: scan weight distributions for anomalies (e.g., extreme outliers, hidden patterns).
* **Behavioral tests**: run the model on a probe dataset and check for unexpected outputs or data leakage.
* **Prompt injection probes**: test for instruction override or jailbreak susceptibility on safety-relevant benchmarks.

A model that fails any detection test is quarantined with status INVALID and blocked from merge or deployment.

## Dependency CVE Tests

EMEP dependencies are scanned for known vulnerabilities:

* **Daily scan**: run `pip-audit` or equivalent on the dependency tree.
* **CI gate**: block merges that introduce new CVEs above severity HIGH.
* **Offline compatibility**: ensure security scanning works in air-gapped environments with a local CVE database.

See [Dependency Safety](/security/dependency-safety) for the full dependency management policy.

## Test Frequency

| Test                      | Frequency            | Owner         |
| ------------------------- | -------------------- | ------------- |
| Signature verification    | Every commit         | Security team |
| Tampered manifest         | Every commit         | Security team |
| Malicious model detection | Nightly              | Security team |
| Dependency CVE            | Daily + every commit | DevOps        |

## Integration Points

* **Security Architecture**: tests validate the security model. See [Security Architecture](/architecture/security-architecture).
* **Model Supply Chain**: tests protect the model supply chain. See [Model Supply Chain](/security/model-supply-chain).
* **License Compliance**: manifest tests overlap with license scanning. See [License Compliance](/security/license-compliance).
* **CI**: security tests run in a dedicated CI stage with restricted access to signing keys.
