adding-api-scopes

adding-api-scopes is a skill for Claude Code, Codex from PostHog/posthog-foss. It costs 171 tokens per session (2,812 once invoked), scanned A, original, MIT.

Guidance for adding named permissions to an API. A permission combines an object, such as a feature flag, with an action such as read or write, and controls what personal keys, OAuth tokens, or MCP clients can access.

In plain words
What is it for?
It helps add a new permission area, decide whether it is public or restricted, and expose it to the appropriate API clients.
Why use it?
It prevents new API endpoints from being exposed with missing, overly broad, or incorrectly listed permissions. It also keeps server definitions, generated types, and the user-facing permission picker consistent.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one. Also seen: installed under .agents/ (shared by several agents).

Good fit It helps add a new permission area, decide whether it is public or restricted, and expose it to the appropriate API clients.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/posthog/posthog-foss/adding-api-scopes
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.

Any agent
npx skills add PostHog/posthog-foss --skill adding-api-scopes
Clone the repo
git clone --depth 1 https://github.com/PostHog/posthog-foss

Made for: Claude Code, Codex.

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 adding-api-scopes

README.md
[![agentmods](https://agentmods.dev/badge/skills/posthog/posthog-foss/adding-api-scopes/github.svg)](https://agentmods.dev/skills/posthog/posthog-foss/adding-api-scopes)
Your own site
<a href="https://agentmods.dev/skills/posthog/posthog-foss/adding-api-scopes"><img src="https://agentmods.dev/badge/skills/posthog/posthog-foss/adding-api-scopes/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for adding-api-scopes

Your own site · 80×15
<a href="https://agentmods.dev/skills/posthog/posthog-foss/adding-api-scopes"><img src="https://agentmods.dev/badge/skills/posthog/posthog-foss/adding-api-scopes.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 171 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,812 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
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.1 $0.00171 $0.02812
Opus 5.5 $0.00068 $0.01125
Sonnet 5.5 $0.00034 $0.00562
Haiku 4.5 $0.00017 $0.00281

Measured 15d ago against content hash 85dd00e3a70a, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

adding-api-scopes 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 15d 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.

.agents/skills/adding-api-scopes/SKILL.md · 99 lines

How it starts

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

Adding an API scope

A scope has two parts: an object and an action, as in feature_flag:read. Adding a scope means adding a scope object, such as feature_flag. It gives tokens feature_flag:read and feature_flag:write. posthog/scopes/catalog.py is the source of the object list. The posthog/scopes/__init__.py docstring says what each module of the package holds. The frontend type and the MCP OAuth list are generated from it. Each object a picker offers also has a ScopeDoc: its name, plural, one-sentence description, group, docs link, the levels a picker offers, whether it reaches the whole organization, and any scope its writes also need. The owning product declares it in products/<name>/backend/scopes.py, and core objects are in CORE_SCOPE_DOCS in posthog/scope_docs.py. The web app's API_SCOPES and API_SCOPE_GROUPS are built from those declarations, so the frontend keeps no copy.

Decide if you need a new scope

Most endpoints fit an existing scope, for example insight:read. Add a new scope only for a product area that a person wants to grant or withhold on its own, on a key or an OAuth app. Name its object with a snake_case singular noun, such as feature_flag.

Decide what kind of scope it is

  • Public: OAuth lists it, MCP can request it, and the key picker offers it. This is the default.
  • Internal: only the server creates tokens with it. Use INTERNAL_API_SCOPE_OBJECTS.
  • OAuth-hidden: a person can paste it into a personal API key, but OAuth clients do not see it. Use this for staff-only or unreleased surfaces. Use OAUTH_HIDDEN_SCOPE_OBJECTS.
  • Privileged: only PostHog staff can give it to an OAuth app, through Django admin or a data migration. An app that registers itself cannot get it, and the CLI login and the key picker presets never include it. Use this for a scope that a partner app must not grant to itself, such as llm_gateway. Use PRIVILEGED_SCOPES. The picker row reads it from the generated scope docs.

Read the full file on GitHub · 99 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. 15d ago Changed · +9 lines · +8 tokens per session 85dd00e3a70a
  2. 17d ago Changed · +2 lines · +2 tokens per session ff47e56e0f18
  3. 24d ago Changed · +2 lines 4b022bb9ca93
  4. 26d ago Changed · +2 lines 95c5dd10f6c9
  5. 1mo ago Changed · -1 lines c2a35d9f5a51
  6. 2mo ago First seen · 85 lines · 161 tokens per session scan A c1e0d35bdc6b

Subscribe to this mod's changes

adding-api-scopes is a skill published in the GitHub repository PostHog/posthog-foss (736 stars, last pushed today), licensed MIT. It adds 171 tokens to every session and 2,812 once invoked, about $0.0007 per session on Opus 5.5. 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-10-01.

Related

adding-api-scopes compared with skills from other repositories

adding-api-scopes next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
adding-api-scopesPostHog/posthog-fossSkill736todayMITA171Claude Code, Codex
mem0-oss-to-platformmem0ai/mem0Skill70k6d agoApache-2.0A217Claude Code, Codex
tao-run-inference-serviceNVIDIA/skillsSkill4.3ktodayApache-2.0A92Claude Code
azure-mgmt-botservice-dotnetmicrosoft/skillsSkill3.3ktodayMITA78Claude Code
fastapi-router-pymicrosoft/skillsSkill3.3ktodayMITA46Claude Code
dev-runtimelangwatch/langwatchSkill5.1ktodayApache-2.0A172Claude Code
api-designericrisco/rsc-harnessSkill707yesterdayMITA105Claude Code, Codex