Jules Agent SDK

VerifiedSafe

Interact with the Jules AI agent via its official Python SDK. Manage sessions, monitor activities, approve plans, and integrate GitHub sources. Handles authentication, polling, and session resumption automatically.

Sby Skills Guide Bot
DevelopmentIntermediate
6/2/2026
Claude Code
#jules#sdk#api#automation#agent

Recommended for

Automated summary

This skill enables interaction with the Jules API using the official Python SDK, managing sessions, activities, and plan approvals.

Strengths

  • Full session management for Jules
  • GitHub source integration
  • Supports automation mode and plan approval

Limitations

  • Requires prior SDK installation
  • Workaround needed for automationMode
  • Transient 404 handling during polling
When to use it

Use this skill to automate tasks via the Jules agent, such as creating sessions with code validation.

When not to use it

Avoid using it if you don't have access to the Jules API or prefer a direct CLI interface.

Security analysis

Safe
Quality score88/100

The skill installs an official Python SDK and uses it to interact with a legitimate API. It includes no destructive commands, exfiltration, or obfuscation. The workaround to use an internal client is a standard JSON POST, not a security risk.

No concerns found

How this analysis is made

Examples

Create a new Jules session
Use the Jules SDK to create a new session with automation mode AUTO_CREATE_PR, set source to my-repo on main branch, and require plan approval. Wait for completion.
List active sessions
List all active Jules sessions for the repository 'my-repo' using the SDK, then resume monitoring the first one found.
Handle session activities with polling
Use the Jules SDK to poll for activities of a session, handling transient 404 errors by retrying.

name: jules-sdk description: A skill for interacting with the Jules API using the jules-agent-sdk Python library. allowed-tools: [run_command, write_to_file, read_url_content]

Jules Agent SDK Skill

Use this skill to automate tasks using the Jules AI agent through its official Python SDK.

Core Capabilities

  • Session Management: Create, list, resumed, and wait for Jules sessions.
  • Activity Monitoring: Track session progress and retrieve agent/user messages.
  • Plan Approval: Automatically or manually approve generated plans.
  • Source Integration: List and filter available code sources (GitHub repositories).

SDK Installation

Ensure dependencies are installed:

pip install jules-agent-sdk python-dotenv

Attribute Handling (CRITICAL)

The SDK returns Pydantic-like models. Use snake_case attributes, NOT camelCase or dictionary keys.

  • ✅ session.source_context
  • ✅ session.update_time
  • ✅ session.state
  • ❌ session.sourceContext
  • ❌ session.get("state")

automationMode Workaround

The high-level client.sessions.create method may miss the automationMode field. Use the internal client to send a raw request:

from jules_agent_sdk.models import Session

data = {
    "prompt": "Your prompt",
    "sourceContext": {
        "source": "sources/github/owner/repo",
        "githubRepoContext": {"startingBranch": "main"}
    },
    "automationMode": "AUTO_CREATE_PR",
    "title": "Session Title",
    "requirePlanApproval": True
}

# Access the internal client to POST raw JSON
response = client.sessions.client.post("sessions", json=data)
session = Session.from_dict(response)

Robust Polling (404 Handling)

Backend resources like activities may return transient 404s immediately after session creation. Always wrap polling in a retry loop:

import time
from jules_agent_sdk.exceptions import JulesAPIError

try:
    activities = client.activities.list_all(session_id)
except JulesAPIError as e:
    if "404" in str(e):
        # Ignore transient 404 and continue polling
        pass
    else:
        raise e

Resume Logic

Before creating a new session, check for active ones to avoid duplicates.

# List sessions for a specific repo
resp = client.sessions.list(page_size=100)
sessions = resp.get("sessions", [])

# Filter by source and status
active_sessions = [
    s for s in sessions 
    if s.source_context and "my-repo" in s.source_context.source
    and s.state not in ["COMPLETED", "FAILED"]
]

if active_sessions:
    session_id = active_sessions[0].id
    # Resume monitoring...

From the file to a first result

The download contains exactly the content displayed on this page. This copy may differ from the latest version in the source repository.

View the source and supporting files

This download contains SKILL.md only. Any scripts, references, templates and dependencies are not included. Get the required files from the source, preserving their directory structure, before continuing.

1. Download the file

Download SKILL.md

From the root of a test project, save the file as .skill-downloads/jules-agent-sdk-mmh8qqbx/SKILL.md, or use the command below. This folder is for inspecting the skill before installation.

Command for macOS/Linux or WSL: requires a POSIX shell and curl. On Windows without WSL, use the download button and create the folder manually.

mkdir -p '.skill-downloads/jules-agent-sdk-mmh8qqbx' && curl --fail --show-error --location 'https://skills-guides.com/api/skills/jules-agent-sdk-mmh8qqbx/download' --output '.skill-downloads/jules-agent-sdk-mmh8qqbx/SKILL.md.part' && mv '.skill-downloads/jules-agent-sdk-mmh8qqbx/SKILL.md.part' '.skill-downloads/jules-agent-sdk-mmh8qqbx/SKILL.md'

2. Check prerequisites

Read SKILL.md before using it. If it references scripts or external services, inspect them and prepare the required access in your test environment.

No recognized prerequisites section in this file. This does not mean it is self-contained: libraries, tools and access requirements may be mentioned elsewhere in the content or source repository.

The platforms on this page are catalog indications. The paths below follow tool documentation; they do not prove this skill has been run in those tools. No minimum tool version is confirmed for this listing.

3. Load the skill

After inspection, copy the complete folder into your project using one of the commands below, then open a new tool session. The command stops if a folder with the same name already exists: compare the files before replacing it.

Claude Code
test -f '.skill-downloads/jules-agent-sdk-mmh8qqbx/SKILL.md' && test -s '.skill-downloads/jules-agent-sdk-mmh8qqbx/SKILL.md' && mkdir -p '.claude/skills' && test ! -e '.claude/skills/jules-sdk' && cp -R '.skill-downloads/jules-agent-sdk-mmh8qqbx' '.claude/skills/jules-sdk'

OpenSkills

OpenSkills must already be installed. The local install/read procedure is checked with OpenSkills 1.5.0, which requires Node.js ≥ 20.6.0. Catalog slugs are not resolved automatically.

Official OpenSkills installation
openskills install './.skill-downloads/jules-agent-sdk-mmh8qqbx'

openskills read 'jules-agent-sdk-mmh8qqbx'

Reading should display the installed file content and its base directory. It does not run the skill or install its dependencies.

For an agent that reads AGENTS.md, then sync the index. This command changes AGENTS.md: review the diff before using it.

openskills sync

Manual method or another tool: attach SKILL.md to a conversation, or open it in an agent that can read files. Include any required supporting resources. No universal folder is recognized by every tool.

4. Try a first task

Use a short, synthetic input: an API endpoint, a small document or an interface brief. In a new conversation, attach the file or give the agent its path, then adapt this request:

Read .skill-downloads/jules-agent-sdk-mmh8qqbx/SKILL.md and apply its instructions to this example: [describe a test input]. Identify any missing files, dependencies or access. Produce the result requested by the skill without inventing data or running unreviewed scripts.

Expected result: output matching the skill instructions, or a precise list of missing prerequisites. A read confirmation alone does not validate a first use. If an external resource is unavailable, that path remains untested.

Related skills