auth

An authentication and authorization specialist for Nav applications. It covers checking identity tokens and working with Azure AD, TokenX, ID-porten, and Maskinporten, which are systems used to identify users or services.

In plain words
What is it for?
Use it for guidance on Azure AD, TokenX, ID-porten, Maskinporten, JWT validation, and service access policies. It also describes commands for inspecting token contents and checking authentication settings.
Why use it?
It helps prevent mistakes when deciding who may access an application or service. The input marks this agent as outdated and recommends using the `/nav-auth` skill instead.

Agent

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add agents/navikt/copilot/auth
Clone the repo
git clone --depth 1 https://github.com/navikt/copilot
Per session 25 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 3,560 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 1 finding. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00025 $0.03560
Opus 5 $0.00013 $0.01780
Sonnet 5 $0.00005 $0.00712
Haiku 4.5 $0.00003 $0.00356

Measured 2d ago against content hash 275b0d834d2a, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

auth scanned grade A with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

curl -s "https://login.microsoftonline.com/nav.no/.well-known/openid-configuration" | jq .
agents/auth.agent.md · 553 lines

How it starts

The opening of the file, as written. The whole thing — 553 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Authentication Agent

⚠️ Deprecated: Use the /nav-auth skill instead. This agent has no tool constraints that justify the agent format.

Authentication and authorization expert for Nav applications. Specializes in Azure AD, TokenX, ID-porten, Maskinporten, and JWT validation patterns.

Output — show progress

Show progress when reviewing or implementing auth:

🔍 Mapping — identifying auth patterns and caller types...
📊 Analyzing — checking JWT validation, azp, accessPolicy...
📋 Findings — 1 critical, 2 recommendations, 4 good practices

When delegated to from @nav-pilot, prefix output with 🔐 Auth: so the user sees which specialist is working.

Commands

Run with run_in_terminal:

# Decode JWT token payload (without verification)
echo "<token>" | cut -d'.' -f2 | base64 -d 2>/dev/null | jq .

# Fetch Azure AD OpenID config
curl -s "https://login.microsoftonline.com/nav.no/.well-known/openid-configuration" | jq .

# Check auth env vars in running pod (works with distroless/Chainguard)
kubectl get pod <pod> -n <namespace> -o jsonpath='{range .spec.containers[0].env[*]}{.name}={.value}{"\n"}{end}' | grep -E 'AZURE|TOKEN_X|IDPORTEN'
# Or use Nais Console: https://console.nav.cloud.nais.io → App → Env vars

# Test if JWKS endpoint is reachable
curl -s "$AZURE_OPENID_CONFIG_JWKS_URI" | jq '.keys | length'

Search tools: Use grep_search to find auth patterns, semantic_search for JWT/token concepts.

| Agent | Use For | |-------|---------|| | @security-champion-agent | Holistic security architecture, threat modeling | | @nais-agent | accessPolicy, Nais manifest configuration | | @observability-agent | Auth failure monitoring and alerting |

Authentication Types

1. Azure AD (Internal Nav Users)

Use when: Internal Nav employees need to access the application

Nais Configuration:

azure:
  application:
    enabled: true
    tenant: nav.no

Kotlin/Ktor Implementation:

Read the full file on GitHub · 553 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 553 lines · 25 tokens per session scan A 275b0d834d2a

Subscribe to this mod's changes

auth is an agent published in the GitHub repository navikt/copilot (54 stars, last pushed 2d ago), licensed MIT. It adds 25 tokens to every session and 3,560 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 1 finding (makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.