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
--mcpappear in the "Bring Your Own MCP" section and are automatically functional in new sessions. Requiresfastmcpinstalled.
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.
Release files for sec-gemini 3.4.8
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| sec_gemini-3.4.8.tar.gz | 231.9 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| sec_gemini-3.4.8-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 537.3 kB
Release files / sec_gemini-3.4.8.tar.gz
| Download URL | sec_gemini-3.4.8.tar.gz |
|---|---|
| Size | 231.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
d18e9ddaf81ee13a2b220936c52464d42e06f12fea6ad4d432bd9eb9d989a600
|
|
BLAKE2b-256 checksum How to use checksums |
b21d278e515774a0232499ed0b6da24f256a6516fff9fca24f8436968d5b7e6c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Release files / sec_gemini-3.4.8-py3-none-any.whl
| Download URL | sec_gemini-3.4.8-py3-none-any.whl |
|---|---|
| Size | 305.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
7a5b0f1c2dd77d9286593cc96ede28891a16b8882131b8fc083d1f98b3657ee5
|
|
BLAKE2b-256 checksum How to use checksums |
fdf8d58380cc341c76858c6aad0f44c0bafbbf59f0f2239f31e83564026019cc
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|