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.
npx skills add PostHog/posthog-foss --skill adding-api-scopesgit clone --depth 1 https://github.com/PostHog/posthog-fossWrote 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.
[](https://agentmods.dev/skills/posthog/posthog-foss/adding-api-scopes)<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.
<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>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.
| Model | Per session | Once 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 |
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.
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. UsePRIVILEGED_SCOPES. The picker row reads it from the generated scope docs.
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.
- 15d ago Changed · +9 lines · +8 tokens per session 85dd00e3a70a
- 17d ago Changed · +2 lines · +2 tokens per session ff47e56e0f18
- 24d ago Changed · +2 lines 4b022bb9ca93
- 26d ago Changed · +2 lines 95c5dd10f6c9
- 1mo ago Changed · -1 lines c2a35d9f5a51
- 2mo ago First seen · 85 lines · 161 tokens per session scan A c1e0d35bdc6b
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.
adding-api-scopes compared with skills from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| adding-api-scopesPostHog/posthog-foss | Skill | 736 | today | MIT | A | 171 | Claude Code, Codex |
| mem0-oss-to-platformmem0ai/mem0 | Skill | 70k | 6d ago | Apache-2.0 | A | 217 | Claude Code, Codex |
| tao-run-inference-serviceNVIDIA/skills | Skill | 4.3k | today | Apache-2.0 | A | 92 | Claude Code |
| azure-mgmt-botservice-dotnetmicrosoft/skills | Skill | 3.3k | today | MIT | A | 78 | Claude Code |
| fastapi-router-pymicrosoft/skills | Skill | 3.3k | today | MIT | A | 46 | Claude Code |
| dev-runtimelangwatch/langwatch | Skill | 5.1k | today | Apache-2.0 | A | 172 | Claude Code |
| api-designericrisco/rsc-harness | Skill | 707 | yesterday | MIT | A | 105 | Claude Code, Codex |