A safe bridge between AI assistants and your computer
Project description
Solveig
A safe bridge between AI assistants and your computer.
Solveig transforms any LLM into a practical assistant that can read files and run commandsโwith your explicit approval for every operation. No more copying and pasting between your terminal and ChatGPT.
๐ Safe โข 150+ tests with 55%+ coverage โข Secure file API โข Command validation
๐ Useful โข Works with any OpenAI-compatible API โข Handles real tasks efficiently
๐งฉ Extensible โข Drop-in plugin system โข Easy to customize and extend
๐ Quick start
# Install from source:
git clone https://github.com/FranciscoSilveira/solveig.git
cd solveig
pip install -e .
# Or install from PyPI:
pip install solveig
# Run a local model:
solveig -u "http://localhost:5001/v1" "Tell me a joke"
# Run from a remote API like OpenRouter:
solveig -u "https://openrouter.ai/api/v1" -k "<API_KEY>" -m "moonshotai/kimi-k2:free" "Summarize my day"
โ FAQ
What is Solveig?
A terminal AI helper that can request file access and run commands with your explicit approval.
Is Solveig an LLM like ChatGPT?
No, it's a safe interface between LLM services and your computer. It can use ChatGPT, Claude, or any OpenAI-compatible service.
Why use Solveig instead of a plain LLM?
LLMs can only work with what you manually provide. If ChatGPT needs a file or command output, you have to copy-paste it yourself. Solveig lets the LLM request exactly what it needs, and you just approve or deny each request.
Why use Solveig over other LLMโtoโshell assistants?
Solveig focuses on preventing dangerous operations through explicit user consent and validation. It prefers direct file access over arbitrary commands when possible, and validates commands with Shellcheck before execution.
Is Solveig safe to run?
Solveig requires your approval for every file read, write, or command execution. It uses Shellcheck to validate commands and catch dangerous patterns. However, you're ultimately responsible for reviewing and denying any request you don't understand.
This is still a tool that connects an AI to your computer - always review what it wants to do.
๐ญ Examples
These were obtained with Kimi K2 on OpenRouter.
click to expand:
Do any of the files in ~/Sync look dangerous?
โโโ User โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Reply:
> Do any of the files in ~/Sync look dangerous?
โ Waiting... (Ctrl+C to stop)
โโโ Assistant โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ I'll check the contents of your ~/Sync directory to identify any potentially dangerous files. Let me start by reading the directory structure and then examine the files within.
[ Requirements (1) ]
[ Read (1) ]
โ First, let me read the ~/Sync directory to see what files are present
๐ ~/Sync (/home/francisco/Sync)
โโโ User โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
[ Results (1) ]
[ Read ]
โ First, let me read the ~/Sync directory to see what files are present
๐ ~/Sync (/home/francisco/Sync)
โโโโ Metadata โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ ๐ /home/francisco/Sync | owner_name=francisco | group_name=francisco | path=/home/francisco/Sync | size=4096 | modified_time=Wed ... โ
โ โโ๐ d1 โ
โ โโ๐ dev.sh โ
โ โโ๐ f1 โ
โ โโ๐ hello.py โ
โ โโ๐ j1.json โ
โ โโ๐ run.sh.bak โ
โ โโ๐ stuff.txt โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
? Allow sending metadata? [y/N]: y
? >
โ Waiting... (Ctrl+C to stop)
โโโ Assistant โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ I can see several files in your ~/Sync directory. Let me examine the contents of the potentially executable files (shell scripts and Python files) to check if they contain any dangerous commands.
[ Requirements (3) ]
[ Read (3) ]
โ Checking the dev.sh shell script for potentially dangerous commands
๐ ~/Sync/dev.sh (/home/francisco/Sync/dev.sh)
โ Checking the hello.py Python script for potentially dangerous code
๐ ~/Sync/hello.py (/home/francisco/Sync/hello.py)
โ Checking the run.sh.bak backup shell script for potentially dangerous commands
๐ ~/Sync/run.sh.bak (/home/francisco/Sync/run.sh.bak)
๐งฉ Plugins
Solveig has an extensible plugin system that automatically discovers and loads plugins on startup.
Plugin Types:
- Hook into requirements: Use
@before()or@after()decorators to validate or process existing requirements (file/command operations) - Schema extensions: Create new requirement types that the LLM can request by extending
Requirementand implementing_actually_solve() - Plugin tests: Add comprehensive test suites in
tests/plugins/test_my_plugin.py
Adding a hook plugin:
- Create a file in
solveig/plugins/hooks/my_plugin.py - Use decorators:
@before(requirements=(CommandRequirement,)),@after(), both, or neither - Add tests in
tests/plugins/test_my_plugin.pyfollowing the existing patterns - Plugins auto-load when Solveig starts - no configuration needed!
Check out solveig/plugins/hooks/shellcheck.py and tests/plugins/test_shellcheck.py for complete examples.
Examples:
click to expand:
Block dangerous commands with custom patterns
from solveig.config import SolveigConfig
from solveig.plugins.hooks import before
from solveig.plugins.exceptions import SecurityError
from solveig.schema.requirement import CommandRequirement
@before(requirements=(CommandRequirement,))
def block_dangerous_commands(config: SolveigConfig, requirement: CommandRequirement):
"""Block commands that could be dangerous to system security."""
dangerous_patterns = [
"sudo chmod 777",
"wget http://", # Block HTTP downloads
"curl http://",
"dd if=", # Block disk operations
]
for pattern in dangerous_patterns:
if pattern in requirement.command:
raise SecurityError(f"Blocked dangerous command pattern: {pattern}")
Anonymize all paths before sending to LLM
import re
from solveig.config import SolveigConfig
from solveig.plugins.hooks import after
from solveig.plugins.exceptions import ProcessingError
from solveig.schema.requirement import ReadRequirement, WriteRequirement
from solveig.schema.result import ReadResult, WriteResult
@after(requirements=(ReadRequirement, WriteRequirement))
def anonymize_paths(config: SolveigConfig, requirement: ReadRequirement|WriteRequirement, result: ReadResult|WriteResult):
"""Anonymize file paths in results before sending to LLM."""
try:
original_path = result.metadata['path']
except:
return
anonymous_path = re.sub(r"/home/\w+", "/home/jdoe", original_path)
anonymous_path = re.sub(r"^([A-Z]:\\Users\\)[^\\]+", r"\1JohnDoe", anonymous_path, flags=re.IGNORECASE)
result.metadata['path'] = anonymous_path
๐ค Contributing
We use modern Python tooling to maintain code quality and consistency:
Development Tools
All code is automatically checked on main and develop branches:
- Formatting:
black .- Ensures consistent code style - Linting:
ruff check .- Catches potential bugs and code quality issues - Type checking:
mypy solveig/ scripts/ --ignore-missing-imports- Validates type hints - Testing:
pytest- Runs full test suite with coverage reporting
Running tests and checks
# Install with testing dependencies:
pip install -e .[dev]
# Unit tests only
python -m pytest tests/unit/ -v
# Specific test class
python -m pytest tests/unit/test_main.py::TestInitializeConversation -v
# Run all checks locally (same as CI)
black . && ruff check . && mypy solveig/ scripts/ --ignore-missing-imports && pytest ./tests/ --cov=solveig --cov=scripts --cov-report=term-missing -vv
๐ Roadmap
Next Steps:
- Enhanced command validation with Semgrep static analysis
- Second-opinion LLM validation for generated commands
- Improve test coverage
- API integration for Claude/Gemini
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file solveig-0.2.8.tar.gz.
File metadata
- Download URL: solveig-0.2.8.tar.gz
- Upload date:
- Size: 78.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
85e3f121eb4efcce19fda553e65dbddc249a3db0c6365cadd251a0b26ea7fb60
|
|
| MD5 |
fc3747afb322ba6bcf121cd20df9f06a
|
|
| BLAKE2b-256 |
a4dc497771b583c8ed426df0f3bcc28471d58da486fd7748823ef25b60b5ec1e
|
Provenance
The following attestation bundles were made for solveig-0.2.8.tar.gz:
Publisher:
cd.yml on FranciscoSilveira/solveig
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
solveig-0.2.8.tar.gz -
Subject digest:
85e3f121eb4efcce19fda553e65dbddc249a3db0c6365cadd251a0b26ea7fb60 - Sigstore transparency entry: 403545470
- Sigstore integration time:
-
Permalink:
FranciscoSilveira/solveig@246e983d3337d1e0f0198ca07cfd0d548f46dd20 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/FranciscoSilveira
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
cd.yml@246e983d3337d1e0f0198ca07cfd0d548f46dd20 -
Trigger Event:
push
-
Statement type:
File details
Details for the file solveig-0.2.8-py3-none-any.whl.
File metadata
- Download URL: solveig-0.2.8-py3-none-any.whl
- Upload date:
- Size: 69.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5eb4e11ebd22abfad94fd34e9ecb64fa54dbf45dae13a251a965f7c45edde534
|
|
| MD5 |
7d54d48c1725b1d142c4a2c3b79bdb70
|
|
| BLAKE2b-256 |
312100e716bb8949c96f71d2d9a7b7ab5ac29320e15c65e3cc970484b1a6c6ef
|
Provenance
The following attestation bundles were made for solveig-0.2.8-py3-none-any.whl:
Publisher:
cd.yml on FranciscoSilveira/solveig
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
solveig-0.2.8-py3-none-any.whl -
Subject digest:
5eb4e11ebd22abfad94fd34e9ecb64fa54dbf45dae13a251a965f7c45edde534 - Sigstore transparency entry: 403545484
- Sigstore integration time:
-
Permalink:
FranciscoSilveira/solveig@246e983d3337d1e0f0198ca07cfd0d548f46dd20 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/FranciscoSilveira
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
cd.yml@246e983d3337d1e0f0198ca07cfd0d548f46dd20 -
Trigger Event:
push
-
Statement type: