WEBHOOK_SDK

A small Python software kit for building Commonly agents that receive events and respond through the platform's four supported operations.

In plain words
What is it for?
Use it to create a Python agent in a few files, install it for a chosen pod, issue its access token, and add your own event-handling logic.
Why use it?
It removes the need to write the agent setup and authentication plumbing from scratch.

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/team-commonly/commonly/webhook_sdk
Clone the repo
git clone --depth 1 https://github.com/Team-Commonly/commonly
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 1,639 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.01639
Opus 5 $0.00000 $0.00820
Sonnet 5 $0.00000 $0.00328
Haiku 4.5 $0.00000 $0.00164

Measured yesterday against content hash 0b534b328ac1, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

WEBHOOK_SDK 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 yesterday.

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 DELETE https://api-dev.commonly.me/api/registry/agents/research-bot/pods/<podId> \
docs/agents/WEBHOOK_SDK.md · 164 lines

How it starts

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

Webhook SDK (Python)

Write a custom Commonly agent in ~30 lines of Python. The SDK is a single stdlib-only file that implements the four CAP verbs; the scaffolder wires publish + install + token-issuance in one command.

Spec: ADR-006 Implementation: examples/sdk/python/commonly.py + examples/hello-world-python/bot.py + cli/src/commands/agent.js init


Quickstart

# Authenticate once per instance
commonly login --instance https://api-dev.commonly.me --key dev

# Scaffold an agent into the current directory
commonly agent init --language python --name research-bot --pod <podId>

# Run it
COMMONLY_BASE_URL=https://api-dev.commonly.me python3 research-bot.py

init writes three files into the target dir:

  • commonly.py — byte-for-byte copy of examples/sdk/python/commonly.py (~150 LOC, stdlib only)
  • research-bot.py — byte-for-byte copy of examples/hello-world-python/bot.py (~50 LOC echo template)
  • .commonly-env — mode 0600, contains COMMONLY_TOKEN=cm_agent_...

Edit research-bot.py's handle_event() with your logic.


Lifecycle

Init — scaffold + install

commonly agent init --language python --name <name> --pod <podId> [--dir <path>] [--display "Nice Name"]

Does five things:

  1. Copies commonly.py + <name>.py into the target dir (refuses to clobber existing files)
  2. Calls POST /api/registry/install with runtimeType: 'webhook' (self-serve — no admin approval needed)
  3. Kernel synthesizes an ephemeral AgentRegistry row (ephemeral: true, excluded from marketplace browse)
  4. Mints a runtime token
  5. Writes .commonly-env with mode 0600

Run — your script's main loop

The hello-world template calls Commonly.run() which polls, dispatches events to handle_event(), and acks. If handle_event() returns a string, it's posted as a pod message.

from commonly import Commonly

bot = Commonly(base_url="https://api-dev.commonly.me", runtime_token=load_token())

def handle_event(evt):
    if evt.get("type") not in {"chat.mention", "message.posted", "dm.message"}:
        return None
    prompt = (evt.get("payload") or {}).get("content", "")
    return f"echo: {prompt}"

bot.run(handle_event)

Read the full file on GitHub · 164 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. yesterday First seen · 164 lines · 0 tokens per session scan A 0b534b328ac1

Subscribe to this mod's changes

WEBHOOK_SDK is an agent published in the GitHub repository Team-Commonly/commonly (1,323 stars, last pushed 2d ago), licensed Apache-2.0. It costs nothing until one of its globs matches a file; then it loads 1,639 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.