---
title: "Security model"
url: https://una-lang.org/en/docs/security/
release: v0.4.0
source: https://github.com/una-lang/una/blob/v0.4.0/README.md
---

# Security model

Every guarantee has the form: *the implementation satisfies its specification, assuming the trusted base behaves as specified and the stated assumptions hold.* `una report` lists four zones for every build:

| Zone | Contents | Who is responsible |
| --- | --- | --- |
| **Proven** | Type safety, confinement of effects and capabilities, information-flow noninterference (termination-insensitive), refinements and contracts | The compiler and the verifier |
| **Trusted** | The compiler, the interpreter and the native runtime, the SMT solver, the standard library, `trusted` modules, host capabilities, the key that authenticates the proof cache | Una maintainers and module owners |
| **Assumed** | The behavior of external systems as declared in `capability` signatures | Capability authors |
| **Human** | That requirements and contracts capture the intent | Requirement owners and reviewers |

Proven means discharged by the checker and the Z3 solver, relative to the verifier's encoding, and an obligation the solver cannot decide is an error (U5002), never a pass. Noninterference and type safety are enforced by the checker's rules; the formal model in Lean proves them for a fragment of the language only, and `una check` does not run that re-check on your package ([Known limits](https://una-lang.org/en/docs/known-limits/), [`docs/security/tcb.md`](https://github.com/una-lang/una/blob/v0.4.0/docs/security/tcb.md)).

Every report lists what is outside the model, among them: timing, termination and resource side channels, and the behavior of external systems beyond their declared signatures. Una proves **conformance to an explicit specification**, not that the specification says the right thing.

A few principles of the design:

- **A function is an equation**: the header is the contract, and the body after `=` is the implementation.
- **`@` marks every direct use of authority**: an operation on the outside world is written `@name.op(...)`, and a public function's `uses` clause lists everything it and the functions it calls may do.
- **Words over symbols**: `implies`, `if error fail`, `expect performed`.
- **One canonical form**: significant indentation and one formatter. Non-canonical source is an error.
- **Visible escape hatches**: `checked`, `trusted` modules and declassification are counted and reported.
- **Unknown is not proven**: an obligation the solver cannot decide is an error, never a pass.

## Information flow: guarantee and scope

From spec/07 §1.

Una enforces **termination-insensitive noninterference up to declassification** (theorem T6, `spec/10 §6`): for any observer at label `l`, two runs whose inputs differ only in values labeled above `l` produce the same values and effects observable at `l`, unless a declassification policy released information to `l`.

Observable channels in the model: return values, failure variants and payloads, capability operation arguments, the occurrence of effects.

Outside the model in v0.1, and reported as such in the build report (`spec/13 §6`, `out_of_model`): timing, termination and divergence, resource consumption and allocation, stack exhaustion, external systems beyond declared signatures, races between the check and the use of a file path, hard links, order of effects across concurrent tasks, the time of a host stop, interference of the host's load with the timing of an expression, uncatchable termination, waits at limits and at `start`, and which branch of `first of` wins, beyond its label (`spec/14 §3` and ADR 0048 for hard links; v0.2, ADR 0065 and `spec/19 §3` for the order of effects, which includes how far a canceled task got; edition 0.4 preview, ADR 0116 rule 21 and `spec/26 §6` for the time of a host stop, the interference of the host's load and uncatchable termination, and ADR 0117 rule 13 and `spec/27 §6`, `§7` and `§9` for the waits at `start` and at the limits of grants, and the winner of `first of`). T6 holds for the result of a `together` block and for each task's own events. A run-time abort is termination: running out of depth or memory (U6003), in v0.2 a header value with a control character (U6004), and host text that is not valid UTF-8 (U6005, S-16, ADR 0086).

## Reporting a vulnerability

See [Reporting a vulnerability](https://una-lang.org/en/docs/security/reporting/).

## Security advisories

The security issues fixed in published releases: [Security advisories](https://una-lang.org/en/docs/security/advisories/).
