# `AshVault.Errors.ProviderForbidden`
[🔗](https://github.com/jakeschurch/ash_vault/blob/main/lib/ash_vault/errors.ex#L257)

Raised when the key store answered and **refused** the request: OpenBao's `403
permission denied`.

This is not `AshVault.Errors.ProviderUnavailable`. The backend is up and made a
decision; retrying the same request with the same credential gets the same answer. It
is a configuration fault an operator must fix — the policy, the token, or the address —
so alert on it rather than retry it.

`:operation` names the request that was refused (`:encrypt`, `:hmac`, `:create_key`,
`:read_key`, `:read_tombstone`, ...) so the missing grant can be found without a
server audit log. It is `nil` when the request is not known. The transit key name is
deliberately absent: it is a reversible encoding of the tenant id.

A tombstone read refused with `403` is this error, which still fails closed: nothing
that cannot read the tombstone ever reports a scope as intact.

# `exception`

```elixir
@spec exception(opts :: Keyword.t()) :: %AshVault.Errors.ProviderForbidden{
  __exception__: true,
  bread_crumbs: term(),
  class: term(),
  operation: term(),
  path: term(),
  provider: term(),
  splode: term(),
  stacktrace: term(),
  vars: term()
}
```

Create an `Elixir.AshVault.Errors.ProviderForbidden` without raising it.

## Keys

- :provider
- :operation

---

*Consult [api-reference.md](api-reference.md) for complete listing*
