# Secrets and masking

**Niro hides secret values before it shows or sends anything.** Masking means replacing a value with a placeholder, such as `<MASK_PASSWORD_001>`. The name stays, so you can still see that `DB_PASSWORD` is set, but not to what.

## Where masking happens

- **In answers to your agent.** When `code_grep` or `get_source_code` reads a config, build or text file, every line is masked first. In a file of `key = value` lines, any value that is not clearly harmless is masked. Examples of such files: `.yml`, `.json`, `.properties`, `Dockerfile`, `go.mod`, `.tf`, `.md`.

- **Before anything is sent.** The coverage audit, the tool-usage record and a whole-repository push are all masked on your computer first.

- **Names of people and companies.** In audit snippets, copyright holders, your email's company and the owner of the git remote become `<author>` and `<company>`.

The masking rules are the same ones Niro's own service uses before anything reaches an AI model. The current rules are version 6.

If your engine is too old to mask, nothing is sent. Items wait until you run `niro upgrade`.

## Files Niro never opens

| Kind | Examples |
| --- | --- |
| Environment files | `.env`, `.env.local`, `.env.production`. Only `.env.example`, `.env.sample` and `.env.template` are read |
| Private keys and key stores | `.pem`, `.key`, `.p12`, `.pfx`, `.jks`, `.keystore`, `.p8`, `.ppk`, and files named `id_rsa`, `id_dsa`, `id_ecdsa`, `id_ed25519` |
| Tool credential files | `.npmrc`, `.pypirc`, `.netrc`, `.pgpass`, `.git-credentials`, `.htpasswd`, `.yarnrc`, `.dockercfg` |
| Config and text files named as secrets | `credentials`, `secrets`, `secret`, `client_secret` (with any ending), for example `secrets.yaml` |
| Config and text files that `.gitignore` covers | Any config or text file your `.gitignore` names |

**Source code is treated differently.** A source file the build reads is read whatever its name: `secrets.py` and `Credentials.java` are searched like any other code. And a source file that git tracks is read even when `.gitignore` names it, the way git itself treats it.

## Seeing real config values on your own computer

If you need your agent to see real values in config files (not in `.env` files, which are never read), turn masking off for one folder. This setting belongs to the engine, and `niro` does not pass it on yet, so run the engine itself:

- Run `niro engine status`. The `engine` line shows where the engine program is.

- In the folder, run that program with `config set show-config-values on`.

Every answer then starts with a note saying values are not masked, and how to turn it back off (`config set show-config-values off`). This never changes what is sent. No tool argument can turn it on, but a coding agent may run the command through its shell, just as you can.

## Settings that hold secrets

`niro env` stores the addresses your code reads (for example `ORDERS_URL`), so the graph can link services. It refuses passwords and tokens, and never stores them. If you type a form of a command it does not know, it does not repeat what you typed, "in case it holds a secret".