Metadata-Version: 2.4
Name: sec-gemini
Version: 3.4.0
Summary: Python SDK for Sec-Gemini
License: Apache-2.0
Requires-Python: >=3.12
Requires-Dist: click>=8.1
Requires-Dist: fastmcp>=3.1
Requires-Dist: grpcio>=1.78
Requires-Dist: httpx>=0.28
Requires-Dist: protobuf>=6.33
Requires-Dist: pydantic>=2.12
Requires-Dist: python-dotenv>=1.2.2
Requires-Dist: pytz>=2024.1
Requires-Dist: pyyaml>=6.0.1
Requires-Dist: rich>=14.3
Requires-Dist: secops>=0.44.0
Requires-Dist: tenacity>=9.1.4
Requires-Dist: textual>=8.1
Description-Content-Type: text/markdown

# Sec-Gemini Python SDK

Python SDK, terminal client, MCP server, and BYOT tunnel for the
[Sec-Gemini](https://secgemini.google) security AI agent.

## Install

```bash
pip install sec-gemini
```

## Set your API key

Get an API key from [secgemini.google/keys](https://secgemini.google/keys), then:

```bash
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:

```bash
# 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:

```python
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):

```bash
sec-gemini-mcp
```

**BYOT** -- connect local tools to the cloud agent:

```bash
# 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](https://secgemini.google/docs/byot/) for details.

## Documentation

Full documentation, guides, and API reference:
**[secgemini.google](https://secgemini.google)**

- [Installation & Quick Start](https://secgemini.google/docs/installation-and-quick-start/)
- [TUI Guide](https://secgemini.google/docs/tui/)
- [Python SDK Guide](https://secgemini.google/docs/python-sdk/)
- [BYOT Guide](https://secgemini.google/docs/byot/)
- [Configuration Reference](https://secgemini.google/docs/reference/config/)

## Requirements

- Python 3.12+
- [uv](https://docs.astral.sh/uv/) (recommended for development)

## License

Internal -- see repository root for license details.


