agent-auth

agent-auth is an agent for coding agents from jeftarmascarenhas/context-mesh. It costs 0 tokens per session (683 once invoked), scanned A, original, MIT.

An authentication agent that adds account signup, login, logout, and token checking to a web application. JWTs are signed tokens commonly used to show that a request belongs to a logged-in user, and bcrypt hashes passwords before storage.

In plain words
What is it for?
Use it to create authentication services, request data types, token-checking middleware, API routes, and a frontend authentication context. The planned routes cover signup, login, and logout.
Why use it?
It supplies the backend and frontend pieces needed to identify users and protect requests. It keeps database schema changes outside the stated scope.

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/jeftarmascarenhas/context-mesh/agent-auth
Clone the repo
git clone --depth 1 https://github.com/jeftarmascarenhas/context-mesh

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for agent-auth

README.md
[![agentmods](https://agentmods.dev/badge/agents/jeftarmascarenhas/context-mesh/agent-auth.svg)](https://agentmods.dev/agents/jeftarmascarenhas/context-mesh/agent-auth)
Your own site
<a href="https://agentmods.dev/agents/jeftarmascarenhas/context-mesh/agent-auth"><img src="https://agentmods.dev/badge/agents/jeftarmascarenhas/context-mesh/agent-auth.svg" alt="Measured on agentmods" height="20"></a>
Per session 0 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 683 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.00000 $0.00683
Opus 5 $0.00000 $0.00342
Sonnet 5 $0.00000 $0.00137
Haiku 4.5 $0.00000 $0.00068

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

Security

Grade A, and why

agent-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 4d 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 -X POST http://localhost:3000/api/auth/signup \
examples/todo-app-complete/context/agents/agent-auth.md · 101 lines

How it starts

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

Agent: Authentication - Todo App

Purpose

Implement user authentication with JWT, including signup, login, and logout functionality.

Context Files to Load

  • @context/intent/feature-user-auth.md
  • @context/decisions/002-auth-approach.md
  • @context/knowledge/patterns/api-design.md
  • @context/knowledge/anti-patterns/avoid-direct-db.md

Scope

  • Allowed directories: backend/src/, frontend/src/
  • Prohibited: Don't modify database schema

Execution Steps

Backend

  1. Create Auth Service

    • Create backend/src/services/auth.service.ts
    • Implement: signup, login, validateToken
    • Use bcrypt for password hashing
    • Use JWT for tokens
  2. Create Auth DTOs

    • Create backend/src/dto/auth.dto.ts
    • Define: SignupDto, LoginDto, AuthResponse
  3. Create Auth Middleware

    • Create backend/src/middleware/auth.middleware.ts
    • Verify JWT token
    • Attach user to request
  4. Create Auth Routes

    • Create backend/src/routes/auth.routes.ts
    • POST /api/auth/signup
    • POST /api/auth/login
    • POST /api/auth/logout
    • Register routes in app.ts

Frontend

  1. Create Auth Context

    • Create frontend/src/context/AuthContext.tsx
    • Manage user state and tokens
    • Provide login, logout, signup methods
  2. Create Auth Components

    • Create frontend/src/components/auth/Login.tsx
    • Create frontend/src/components/auth/Signup.tsx
    • Create frontend/src/components/auth/Logout.tsx
  3. Create Auth Pages

    • Create frontend/src/pages/Login.tsx
    • Create frontend/src/pages/Signup.tsx
  4. Create API Service

    • Create frontend/src/services/api.ts
    • Configure Axios with auth interceptor

API Endpoints

POST /api/auth/signup
Body: { email, password, name }
Response: { user: { id, email, name }, token }

POST /api/auth/login
Body: { email, password }
Response: { user: { id, email, name }, token }

POST /api/auth/logout
Response: { message: "Logged out" }

Definition of Done

  • Auth service handles signup, login, logout
  • Passwords are hashed with bcrypt
  • JWT tokens are generated and validated
  • Auth middleware protects routes
  • Frontend AuthContext manages state
  • Login/Signup forms work
  • Token stored in httpOnly cookie or localStorage
  • Protected routes redirect to login

Read the full file on GitHub · 101 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. 4d ago First seen · 101 lines · 0 tokens per session scan A b216be7c2dc9

Subscribe to this mod's changes

agent-auth is an agent published in the GitHub repository jeftarmascarenhas/context-mesh (39 stars, last pushed 7mo ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 683 tokens. 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.