Skip to main content

Sec-Gemini Python SDK

Python SDK, terminal client, MCP server, and BYOT tunnel for the Sec-Gemini security AI agent.

Install

pip install sec-gemini

Set your API key

Get an API key from secgemini.google/keys, then:

sec-gemini set-key

What's included

  • Terminal UI (sec-gemini) -- interactive chat with the agent
  • Python SDK -- async client for programmatic access
  • MCP server (sec-gemini-mcp) -- expose the SDK to AI assistants
  • BYOT client (sec-gemini-byot) -- connect local tools to the cloud agent
  • 35 baseline tools in 5 categories: file operations, shell, Python execution, JavaScript execution, and network analysis

Quick start

Terminal UI -- interactive chat with the agent:

# Standard launch
sec-gemini

# Launch with local MCP scripts (BYOT "magic" mode)
sec-gemini --mcp ./my_tools.py

Tip: Local scripts passed via --mcp appear in the "Bring Your Own MCP" section and are automatically functional in new sessions. Requires fastmcp installed.

Python SDK -- programmatic access:

import asyncio
from sec_gemini.services.backend import Backend

async def main():
    backend = Backend(api_key="YOUR_KEY")
    await backend.connect()
    session = await backend.create_session()
    await backend.send_prompt(session.session_id, "Analyze example.com")
    async for msg in backend.stream_messages(session.session_id):
        print(f"[{msg.message_type}] {msg.content[:200]}")
    await backend.close()

asyncio.run(main())

MCP server -- expose the SDK to AI assistants (Claude Code, Gemini CLI):

sec-gemini-mcp

BYOT -- connect local tools to the cloud agent:

# Minimal: connect with base local tools (enabled by default)
uvx --from sec-gemini sec-gemini-byot

# Connect additional MCPs and local skills
uvx --from sec-gemini sec-gemini-byot --mcp ./my_tools.py --skills ./my_skill.md

Security notice: BYOT base tools (shell, file, Python, JavaScript) run directly on your machine with no sandboxing. Run inside a container or VM. See the BYOT Guide for details.

Documentation

Full documentation, guides, and API reference: secgemini.google

Requirements

  • Python 3.12+
  • uv (recommended for development)

License

Internal -- see repository root for license details.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

sec_gemini-3.4.4.tar.gz (185.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

sec_gemini-3.4.4-py3-none-any.whl (255.7 kB view details)

Uploaded Python 3

File details

Details for the file sec_gemini-3.4.4.tar.gz.

File metadata

  • Download URL: sec_gemini-3.4.4.tar.gz
  • Upload date:
  • Size: 185.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.14

File hashes

Hashes for sec_gemini-3.4.4.tar.gz
Algorithm Hash digest
SHA256 e3cbd23727ba7005a10c47e5791c75c677ab43b615fff97404db6ea0fed7e8fc
MD5 75725bda7b411ed318307625078228cb
BLAKE2b-256 d70044a753760982e60e11d73178456ad746757b38cf53db71db03a54c5eea67

See more details on using hashes here.

File details

Details for the file sec_gemini-3.4.4-py3-none-any.whl.

File metadata

  • Download URL: sec_gemini-3.4.4-py3-none-any.whl
  • Upload date:
  • Size: 255.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.14

File hashes

Hashes for sec_gemini-3.4.4-py3-none-any.whl
Algorithm Hash digest
SHA256 54efd53b6f496acbc3e49c777ba2de22771c0f53022fd572112798ad8a0d1cd3
MD5 6277ea3c3d5d074c4ed0b40710153fb1
BLAKE2b-256 35d4097ad4c8f1de156454827698a2302c793ddc388beee7b7b4e9906ad09396

See more details on using hashes here.

Release history Release notifications | RSS feed

3.4.5

2 files

This release

3.4.4 This release

2 files

3.4.2

2 files

3.4.1

2 files

3.4.0

2 files

3.3.0

2 files

3.2.0

2 files

3.1.1

2 files

1.1.6

2 files

1.1.5

2 files

1.1.4

2 files

1.1.3

2 files

1.1.2

2 files

0.1.0

2 files

0.0.1

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page