[ Blocks SDK ]

Build your own agents and automations, in Python.

Write a function, choose the events it runs on and push it. Blocks runs it in a cloud sandbox with your repos, secrets and integrations wired in. It's the same SDK every Blocks agent is built on.

.blocks/issue-fixer/main.py
from blocks import task, on, repo
from blocks_control_sdk import Codex, CodexAgentConfig
from blocks_control_sdk.constants.openai import OpenAIModels
@task(name="issue-fixer")
@on("github.issues")
def issue_fixer(input):
issue = input["issue"]
if "agent" not in [label["name"] for label in issue["labels"]]:
return
# Put a coding agent to work, in this task's sandbox
agent = Codex()
agent.init(CodexAgentConfig(model=OpenAIModels.gpt_5_3_codex))
summary = agent.query_sync_beta(
f"Fix #{issue['number']}: {issue['title']}\n\n{issue['body']}\n"
"Open a pull request once the tests pass."
)
repo.comment_on_issue(issue_number=issue["number"], body=summary)
Terminal
$ pip install blocks-sdk
$ blocks init --key $BLOCKS_API_KEY
$ blocks push .blocks/issue-fixer/main.py
Building image (cached)
✓ Registered issue-fixer · revision 3
✓ Runs on github.issues
[ Everywhere an agent goes ]

Your agent, next to Claude Code and Codex.

Once it's pushed, your agent works anywhere the built-in agents do, for everyone in the workspace.

The dashboard

Pick it from the agent menu for any session, in the browser or the desktop app.

Ad-hoc

Hand it work from Slack, Linear, Jira or a pull request comment.

PR review

Make it the reviewer on every pull request in a repository.

Automations

Run it on a pull request, a ticket or a schedule, like any other agent.

A
Pinned
Migrate billing to Stripe v2
Nightly critical-bug hunt
Q4 launch checklist
Folders
Payments6
Fix race in checkout test
Fix double charge on checkout retry
Platform11
Recents
Upgrade Next.js to 16
Flaky e2e on /settings
Add audit log export
Review #2214 Rate limiter
Dark mode for the docs site
Rotate the webhook secret
Explain the billing retry flow
Fix the new Sentry issues in web
Accept edits onIissue-fixer
Search agents...
Agents
Claude Code
Codex
Gemini CLI
Cursor
Kimi Code
Iissue-fixer
[ Built on the SDK ]

Every agent on Blocks is an SDK agent.

Claude Code, Codex, Antigravity, Cursor, OpenCode and Kimi on Blocks are each one Python entry point on this SDK: an @agent, the events it answers and a call into the harness. Yours gets the same triggers, sandbox and chat.

Claude CodeCodexAntigravityCursorOpenCodeKimi Code
agents/src/claude-agent.py
from blocks import agent, on
from entrypoint import agent_entrypoint, AgentOptions
@agent(
name="claude",
runner="medium_cpu",
plugins=["CLAUDE_CODE"],
required_env_vars=["ANTHROPIC_API_KEY"],
features=["plan", "runtime_model_selection"],
)
@on("webhook")
@on("slack.mention")
@on("github.issue_comment")
@on("github.pull_request")
@on("linear.assign")
@on("atlassian.jira_assign")
@on("gitlab.merge_request")
@on("bitbucket.pullrequest")
# … 19 triggers in all
def claude_agent(input, config: ClaudeAgentConfig):
chat = Chat()
prompt = resolve_prompt(BLOCKS_TRIGGER_ALIAS, input, llm_provider)
agent_entrypoint(prompt, AgentOptions(chat=chat, agent_config=config, ...))
[ Use cases ]

From a ten-line bot to a full agent.

Start with an automation for one event, and grow it into an agent your team talks to.

triage/main.py
from blocks import task, on, repo
@task(name="triage")
@on("github.issues")
@on("github.issue_comment")
def triage(input):
issue = input["issue"]
if issue["labels"]:
return # already triaged
repo.update_issue(issue_number=issue["number"], labels=["needs-triage"])
repo.comment_on_issue(
issue_number=issue["number"],
body="Thanks! Can you share the steps to reproduce this?",
)

Run on the events you care about.

Issues, pull requests, comments, Linear tickets and Slack mentions. Stack @on decorators and one function handles every one of them.

[ Ideas ]

What will you build?

A few things teams build with the SDK. Each one is a Python function and the events it runs on.

issue-fixer@task

Picks up issues labelled agent, fixes them and opens a pull request.

issues
house-rules-reviewer@task

Reviews every pull request against your team's own conventions.

pull_request
sre-agent@agent

Answers on-call questions in Slack with your logs, dashboards and runbooks.

mention
flaky-test-hunter@task

Reruns the suite every night, quarantines flaky tests and files the fixes.

daily
sentry-triage@task

Turns each new Sentry issue into a ticket with a cause and a proposed fix.

webhook
dependency-bumper@task

Upgrades dependencies every week, fixes what breaks and opens one PR.

weekly
release-notes@task

Writes user-facing release notes from what merged since the last tag.

webhook
ticket-groomer@agent

Adds acceptance criteria, estimates and the files involved to new tickets.

issues
docs-keeper@task

Updates the docs whenever a pull request changes a public API.

pull_request

Build your first agent on Blocks.

Install the SDK, write a function and push it. It runs on the next event.

Blocks SDK – Build your own agents and automations in Python