logout

A command that ends the local agentsecrets session and removes cached login credentials from the current computer.

In plain words
What is it for?
It helps invalidate the remote refresh token when possible, remove credentials from the operating system’s secure storage, and wipe local session settings without deleting project links or stored secrets.
Why use it?
It clears locally stored access tokens and keys when you want to sign out or protect the machine.

Command

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 commands/the-17/agentsecrets/logout
Clone the repo
git clone --depth 1 https://github.com/The-17/agentsecrets
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 497 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. 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.00497
Opus 5 $0.00000 $0.00249
Sonnet 5 $0.00000 $0.00099
Haiku 4.5 $0.00000 $0.00050

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

Security

Grade A, and why

logout scanned grade A with 0 findings 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.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

docs/commands/logout.md · 74 lines

How it starts

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

agentsecrets logout

Clear your session and remove cached credentials from this machine.

Usage

agentsecrets logout

Description

logout terminates your session on the current machine and wipes all locally cached credentials. It does not affect other machines, team members, or your stored secrets, only the local session.


What Gets Cleared

logout operates in three steps:

1. Remote invalidation (best-effort)
Sends a POST to auth.logout. If the server is reachable, it invalidates the refresh token, preventing it from being used to generate new access tokens. If the server is unreachable (offline, network issue), logout still proceeds locally.

2. OS keychain purge
Removes the private key from the OS keychain:

  • macOS: deletes the Keychain entry
  • Windows: removes the Credential Manager entry
  • Linux: removes the Secret Service entry

3. Config wipe
Clears ~/.agentsecrets/config.json of:

  • JWT access and refresh tokens
  • Cached workspace keys
  • User email and workspace bindings

What Is NOT Cleared

  • .agentsecrets/project.json in any project directory — your project links remain intact. Logging back in and running agentsecrets secrets pull restores everything immediately.
  • Secrets in the OS keychain — secret values stored by secrets pull (keyed by project ID) are not removed. They remain available for agentsecrets env even after logout, until they are explicitly deleted with agentsecrets secrets delete.
  • Remote data — your secrets, workspace, and team remain on the server, encrypted.

When to Use

# Switching to a different account
agentsecrets logout
agentsecrets login   # or agentsecrets init for a new account

# Shared machine — end of session
agentsecrets logout

# After a credential-related security incident
agentsecrets logout
# Then rotate the affected secrets:
agentsecrets secrets set COMPROMISED_KEY=new_value

Read the full file on GitHub · 74 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 · 74 lines · 0 tokens per session scan A f26d4c1594bd

Subscribe to this mod's changes

logout is a command published in the GitHub repository The-17/agentsecrets (172 stars, last pushed 4d ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 497 tokens. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.