---
title: "17.10 Recap and reference"
url: https://una-lang.org/en/learn/information-flow/recap-and-reference/
release: v0.4.0
edition: "0.2"
---

# 17.10 Recap and reference

## 17.10.1 For agents

:::agents
`una --json check .` reports the U4xxx codes in the domain `security`. For [the leak the checker stops](https://una-lang.org/en/learn/information-flow/day-to-day-shipping-notices-with-labels/#the-leak-the-checker-stops):

```json include="steps/36-leak-2/expected/commands/json.txt#L2"
{"schema":"una.diagnostics/1","diagnostics":[{"schema":"una.diagnostic/1","code":"U4003","severity":"error","domain":"security","message":"`@log.print` accepts `public` data, and this argument is `secret[PII]`","primary":{"file":"src/notices.una","start":{"line":78,"col":16},"end":{"line":78,"col":52}},"related":[],"repairs":[{"rank":1,"escape_cost":0,"description":"send `@log.print` only data labeled `public` or lower, or send this value to an operation that accepts `secret[PII]`","edit":null},{"rank":2,"escape_cost":1,"escape":{"kind":"trusted","cost":"the guarantee then rests on trusted code, whose labels are not checked: a policy releases the data, or a module joins the trusted base; it is listed in the build report and needs review"},"description":"declassify the value through a policy of a trusted module","edit":null}],"explain":"una explain U4003"}],"fixable":0}
```

Neither repair has an `edit`, so `una fix` changes nothing: each needs a decision about the data. The first keeps the label. The second, a policy, has `escape_cost` 1 and an `escape` of kind `trusted`: it moves the guarantee onto trusted code. Prefer the repairs with `escape_cost` 0. The compact rule: *a value flows only to a place labeled at or above it, branches label what they decide, `fail` needs a `public` program counter, and only a `policy` of a module trusted in its header and in `una.toml` lowers a label.*
:::

## 17.10.2 Recap

:::recap
- A label is a level and categories: `public`, `internal`, `confidential`, `secret`, `restricted`, and categories such as `[PII]` that `una.toml` declares.
- A result carries the labels of what it was computed from, and of every condition or loop that chose it.
- Every operation argument is a sink. `Console.print` accepts `public`, and your own operations accept what `accepts` says.
- Data read from files or the environment is `internal`. A keyed hash from `Keys.hmac`, a `Hashed`, keeps the label of what it hashed, and only `==` and `!=` read it.
- Under a branch on labeled data, return a labeled value instead of failing or acting.
- Lower a label only through a `policy` with a private `via` function, in a module trusted in its header and in `una.toml`.
- Release the least you can, test each policy with examples, and read the release list in `una report .`.
:::

## 17.10.3 Reference

:::reference
- Construct pages: [labels](https://una-lang.org/en/docs/language/information-flow/labels/), [`policy`](https://una-lang.org/en/docs/language/information-flow/policy/), [trusted modules](https://una-lang.org/en/docs/language/information-flow/trusted/), [host capabilities](https://una-lang.org/en/docs/language/capabilities/host/), [`example`](https://una-lang.org/en/docs/language/examples/example/)
- Configuration: [`[labels] categories`](https://una-lang.org/en/docs/configure/labels/categories/), [`[trusted] modules`](https://una-lang.org/en/docs/configure/trusted/modules/)
- Standard library: [the prelude and the host capabilities](https://una-lang.org/en/docs/std/)
- Diagnostics: [U1001](https://una-lang.org/en/docs/errors/U1001/), [U2001](https://una-lang.org/en/docs/errors/U2001/), [U3015](https://una-lang.org/en/docs/errors/U3015/), [U4001](https://una-lang.org/en/docs/errors/U4001/), [U4002](https://una-lang.org/en/docs/errors/U4002/), [U4003](https://una-lang.org/en/docs/errors/U4003/), [U4004](https://una-lang.org/en/docs/errors/U4004/), [U4005](https://una-lang.org/en/docs/errors/U4005/), [U4007](https://una-lang.org/en/docs/errors/U4007/), [U7005](https://una-lang.org/en/docs/errors/U7005/)
- Specification: [information flow](https://una-lang.org/en/docs/spec/07-information-flow/), including [the guarantee and its scope](https://una-lang.org/en/docs/spec/07-information-flow/#s1) (noninterference), [labels](https://una-lang.org/en/docs/spec/07-information-flow/#s2), [declassification policies](https://una-lang.org/en/docs/spec/07-information-flow/#s5) (rule 3: inside `via` functions labels are not checked, and they are part of the trusted computing base) and [checking](https://una-lang.org/en/docs/spec/07-information-flow/#s7) (rules 3 to 6), [capabilities and effects](https://una-lang.org/en/docs/spec/05-capabilities-and-effects/), [memory model](https://una-lang.org/en/docs/spec/17-memory-model/#s6) (labels in loops and on editable names), [standard library](https://una-lang.org/en/docs/spec/14-standard-library/) (the host capabilities and their labels), [diagnostics and ABI](https://una-lang.org/en/docs/spec/13-diagnostics-and-abi/)
- Security model: [what is proven, trusted and outside the model](https://una-lang.org/en/docs/security/)
:::
