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.
from blocks import task, on, repofrom blocks_control_sdk import Codex, CodexAgentConfigfrom 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)$ pip install blocks-sdk$ blocks init --key $BLOCKS_API_KEY$ blocks push .blocks/issue-fixer/main.pyBuilding image (cached)✓ Registered issue-fixer · revision 3✓ Runs on github.issues
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.
Claude CodeEvery 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.

from blocks import agent, onfrom 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 alldef 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, ...))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.
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@taskPicks up issues labelled agent, fixes them and opens a pull request.
house-rules-reviewer@taskReviews every pull request against your team's own conventions.
sre-agent@agentAnswers on-call questions in Slack with your logs, dashboards and runbooks.
mentionflaky-test-hunter@taskReruns the suite every night, quarantines flaky tests and files the fixes.
sentry-triage@taskTurns each new Sentry issue into a ticket with a cause and a proposed fix.
dependency-bumper@taskUpgrades dependencies every week, fixes what breaks and opens one PR.
release-notes@taskWrites user-facing release notes from what merged since the last tag.
ticket-groomer@agentAdds acceptance criteria, estimates and the files involved to new tickets.
docs-keeper@taskUpdates the docs whenever a pull request changes a public API.