---
title: "U7005: Trusted module not declared in both header and `una.toml`"
url: https://una-lang.org/en/docs/errors/U7005/
release: v0.4.0
source: https://github.com/una-lang/una/blob/v0.4.0/crates/una-explain/explain/U7005.md
---

# U7005: Trusted module not declared in both header and `una.toml`

A module is declared trusted in its header or in its package's settings, `una.toml` or from edition `0.4` `ita.una`, but not in both. U7005 also reports a listed module that the package does not have.

## Why Una rejects it

A trusted module may declare information-flow policies (`spec/07 §6`), so trust is declared twice: the module's header says `trusted module`, and `una.toml` lists the module under `[trusted] modules`, or from edition `0.4` the `trusted` section of `ita.una` does. U7005 reports a module declared in only one of the two places, and a listed module that the package does not have.

A file checked on its own has no `una.toml` and no `ita.una`, so a `trusted module` header there is always U7005.

## How to fix it

- The repair that keeps the trusted base comes first: remove `trusted` from the header, or remove the entry from `[trusted] modules`, as the fixed example does. A policy outside a trusted module is U4004, so narrowing trust never lets a policy through silently.
- Completing the declaration in the other place is the last repair, marked as an escape (ADR 0095): the module joins the trusted base.

## The repair at a glance

`src/keys.una`

```diff
- trusted module keys
+ module keys

  pub pepper() -> Int = 7
```

## Failing example

`src/keys.una`

```una
trusted module keys

pub pepper() -> Int = 7
```

## Fixed example

`src/keys.una`

```una
module keys

pub pepper() -> Int = 7
```
