# Algorithms and policy packs

Aegis knows far more algorithms than any policy should allow. Three things decide what actually runs: the **catalogue** says what each algorithm is, the **gates** decide whether an operation may run now, and the **policy pack** in force says what your organisation allows.

## The catalogue

Every algorithm has one record, shipped with the engine: its kind (KEM, signature, cipher, hash…), family, parameter set, security category, sizes, the specification revision it implements, its standards and identifiers, its module, and a **maturity** label with its source and the date it was checked. Ask for it:

- Aegis Core: `GET /v1/algorithms` and `GET /v1/algorithms/{id}`, or `aegis algorithms` and `aegis algorithm <name>`.
- Aegis Cloud: `GET /api/v1/algorithms` lists what your plan allows.

| Maturity | Meaning | A production policy may |
| --- | --- | --- |
| `standard` | A final standard from a recognised body (FIPS, SP, RFC, ISO) | Use it |
| `conservative` | A final standard kept for defence in depth or a regional profile | Use it when the profile says so |
| `transition` | Classical public-key cryptography: not quantum-safe | Use it inside hybrids, or alone until the policy's retirement date |
| `stateful` | Hash-based signatures whose key changes with every signature (LMS, XMSS) | Verify; signing needs hardware that keeps the state |
| `candidate` | In an open standardisation process | Not use it |
| `regional` | Selected or standardised by one country | Use it only under that country's profile |
| `research`, `retired`, `broken` | No standard path, abandoned, or attacked | Never use it; a laboratory deployment can run it, labelled on every result |

Algorithms are grouped in **modules** (`standard-pqc`, `symmetric`, `classical`, `hybrid`, `conservative`, the regional modules and others), which the licence and the policy switch on and off as units.

## The four gates

An operation runs only if every gate allows it:

| Gate | Question | Owner |
| --- | --- | --- |
| Build | Is an implementation present in this binary, or as a verified module? | qblackbit, at release |
| Licence | Does the licence include this module? | qblackbit, by contract |
| Policy | Does the policy in force allow this algorithm, for this operation, caller and key? | You |
| Health | Did the algorithm pass its self-test, and is it free of a revocation advisory? | The engine |

Gates tell **applying** protection (generate, sign, encrypt, encapsulate) from **processing** protection that already exists (verify, decrypt, decapsulate). Retiring an algorithm closes the first and leaves the second open until your data has moved. An expired licence also closes only new protection by licensed extras: nothing stops you reading your own data or exporting your own keys.

## Isolation

Algorithms from final standards with reviewed implementations run inside the engine. Native reference code, candidates and national algorithms run in **separate sandboxed processes** with no file access, no network and a system-call allow-list, started only by a verified digest. A flaw in one of them cannot reach another algorithm's keys.

## Policy packs

A policy pack is a signed set of rules per operation, caller role, key and date, with a rule for hybrids, each rule citing its source and section. Packs only ever narrow what the gates allow. Aegis Core ships five:

| Pack | Follows |
| --- | --- |
| `baseline` | Aegis's own defaults |
| `us-nist-ir8547` | NIST IR 8547, the US transition schedule |
| `us-cnsa-2.0` | The NSA's CNSA 2.0 suite for national security systems |
| `de-bsi-tr02102` | BSI TR-02102-1, Germany's technical guideline |
| `fr-anssi-hybrid` | ANSSI's guidance, which asks for hybrids |

Read and use them:

- `GET /v1/policy`: the packs, the one in force, and whether signed imports can be checked.
- `GET /v1/policy/packs/{id}`: a pack's rules with their sources.
- `POST /v1/policy/activate`: put a pack in force, with a reason (audited).
- `GET /v1/policy/protocols`: what the pack in force allows, as TLS groups and signature schemes, IKEv2 transforms, SSH methods, JOSE and COSE identifiers and X.509 algorithms. Give this to the teams that configure those protocols.
- `POST /v1/policy/packs` and `POST /v1/policy/advisories`: import a signed pack or advisory. An advisory can only narrow, and one that would roll back is refused.
- On the command line: `aegis policy list`, `aegis policy show us-cnsa-2.0`, `aegis policy protocols`.

Asking for a policy name such as `qbb-hybrid-1` instead of an algorithm in your requests, with defaults per purpose in each pack, is (Planned). Today you name the algorithm and the pack decides whether it is allowed.

Aegis Cloud plans carry a fixed list of standard and hybrid algorithms instead of a choice of pack.

Next: [Vault and keys](https://docs.qblackbit.com/concepts/vault.md).
