Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
4336f9a
Add security hardening design doc and roadmap
Mar 29, 2026
fc614c9
Replace os.system() with subprocess.run() for safe process spawning
Mar 30, 2026
3f0a0c9
Add bandit, gitleaks, pip-audit, coverage to CI pipeline
Mar 30, 2026
3e04fb5
Add AI_PRINCIPLES.md and operator_use/guardrails/ module
Mar 30, 2026
ab91acf
Add security and e2e test suite scaffolds
Mar 30, 2026
c418f56
Update uv.lock for new dev dependencies (bandit, pip-audit, pytest-cov)
Mar 30, 2026
b08103a
Fix Qodo review findings: browser classification, path containment, C…
Mar 30, 2026
84c3cf7
Fix CI failures: bandit, gitleaks org license, pip-audit CVEs
Mar 30, 2026
8dd8c41
Fix path traversal in resolve() — use is_relative_to() not startswith…
Mar 30, 2026
61e1271
Sanitize download filename and URL scheme [#15]
Mar 30, 2026
331c45b
Fix XPath injection — escape all dangerous chars in JS string context…
Mar 30, 2026
23337f8
Update test_utils to match secure resolve() behavior [#14]
Mar 30, 2026
e3f3dd0
Block sensitive JS API access in browser script action [#18]
Mar 30, 2026
deb40e2
Fix download to use sanitized filename and enforce 100MB size limit […
Mar 30, 2026
cc249ec
Add XPath syntax validation before escaping [#16]
Mar 30, 2026
e370ab0
Add symlink, unicode, null byte traversal vectors to security tests […
Mar 30, 2026
a66731d
Remove unused tempfile import [#14]
Mar 30, 2026
2096bb2
docs: cursorless UI automation design doc and implementation plan
Mar 31, 2026
b403f1d
feat(macos): cursorless click via InvokePattern with coordinate fallback
Mar 31, 2026
37fe41a
fix(macos): add debug logging and False-invoke fallback to cursorless…
Mar 31, 2026
263a9c9
feat(macos): cursorless type via ValuePattern.SetValue with coordinat…
Mar 31, 2026
e812be5
feat(windows): cursorless click via InvokePattern with coordinate fal…
Mar 31, 2026
5f26767
feat(windows): cursorless type via ValuePattern.SetValue with coordin…
Mar 31, 2026
edcbfab
fix: bump aiohttp/cryptography for CVEs, suppress bandit B310 [ci]
Apr 13, 2026
20628be
fix: update test_utils to expect PermissionError for absolute paths [ci]
Apr 13, 2026
e6ea950
fix: remove duplicate pytest import in test_utils (ruff F811)
Apr 19, 2026
c578cb7
fix: update test imports for refactored tools paths [ci]
Apr 19, 2026
40600d2
fix: fix remaining test_agent.py and e2e imports for refactored tools…
Apr 19, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .bandit
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[bandit]
# B104: Binding to 0.0.0.0 is intentional — Operator-Use is a local agent server
# designed to accept connections on the LAN. This is documented behaviour.
skips = B104
40 changes: 39 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,50 @@ jobs:

- name: Install uv
uses: astral-sh/setup-uv@v3
with:
enable-cache: true

- name: Install dependencies
run: uv sync --all-extras

- name: Lint with ruff
run: uv run ruff check .

- name: Run bandit security scan
run: uv run bandit -r operator_use/ -ll -q -c pyproject.toml

- name: Run tests
run: uv run pytest tests/ -q --tb=short
run: uv run pytest tests/ -q --tb=short --cov=operator_use --cov-report=xml --cov-fail-under=1

- name: Upload coverage report
uses: codecov/codecov-action@v4
with:
fail_ci_if_error: false

secrets:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Run gitleaks secret scan
run: |
curl -sSfL https://github.com/gitleaks/gitleaks/releases/download/v8.24.3/gitleaks_8.24.3_linux_x64.tar.gz \
| tar xz -C /tmp gitleaks
/tmp/gitleaks detect --source . --verbose --redact --exit-code 1

audit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.12"
- uses: astral-sh/setup-uv@v3
with:
enable-cache: true
- name: Install dependencies
run: uv sync --all-extras
- name: Run pip-audit
# CVE-2026-4539 (pygments ReDoS) ignored — no fix version released yet
run: uv run pip-audit --desc on --ignore-vuln CVE-2026-4539
86 changes: 86 additions & 0 deletions AI_PRINCIPLES.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
# AI Safety Principles for Operator-Use

Operator-Use gives an LLM agent real-world capabilities: terminal access, browser
control, file manipulation, and more. These principles define the safety boundaries
that every feature, tool, and integration must respect.

---

## 1. Least Privilege

**The agent has the minimum permissions needed for the current task.**

**In Operator-Use:**
- Tool profiles (`minimal`, `coding`, `full`) gate which tools are available. `minimal` is the default; `full` requires explicit opt-in.
- Per-task scoping ensures that a "search the web" request does not grant terminal access.
- New tools must declare the narrowest permission set that covers their use case.

---

## 2. Human Oversight

**No irreversible action without human confirmation.**

**In Operator-Use:**
- Destructive operations (file deletion, production deploys, arbitrary script execution) require user approval before execution.
- Every tool call is logged with timestamp, user, input, and output to create a complete audit trail.
- A `/stop` command immediately halts all agent activity, acting as a kill switch.

---

## 3. Transparency

**The agent explains what it is doing and why before acting.**

**In Operator-Use:**
- Before executing high-risk tools the agent sends a preview message describing the planned action.
- Intermediate status messages keep the user informed of multi-step operations.
- Error states are surfaced clearly rather than silently retried or swallowed.

---

## 4. Containment

**Actions are bounded to the workspace and reversible where possible.**

**In Operator-Use:**
- Filesystem operations are restricted to the workspace directory; path traversal is blocked.
- The browser runs with a clean profile by default, with no access to real cookies or sessions.
- Terminal commands are filtered through an allowlist, blocking shell escapes and command injection.

---

## 5. Privacy by Default

**Never access, store, or transmit data beyond what the current task needs.**

**In Operator-Use:**
- Credentials and API keys are masked in all logs and never included in LLM context.
- Session history is encrypted at rest and auto-expires after a configurable TTL.
- Message content is not logged at INFO level; debug logging requires explicit opt-in.

---

## 6. Fail Safe

**When uncertain, stop and ask rather than proceed.**

**In Operator-Use:**
- If a tool call targets an unusual or sensitive path (e.g., `/etc/shadow`, SSH keys), the agent pauses and requests confirmation.
- A circuit breaker halts execution after N consecutive tool failures and reports the situation to the user.
- Confidence thresholds prevent the agent from executing actions it cannot justify.

---

## Development Checklist

Before merging any feature that touches agent behavior:

- [ ] Input validation: all external inputs validated
- [ ] Path containment: file ops stay within workspace boundaries
- [ ] No credential exposure: API keys never logged or in LLM context
- [ ] Least privilege: new tools request only needed permissions
- [ ] Human-in-the-loop: destructive actions require user confirmation
- [ ] Rate limited: new endpoints/tools have rate limiting
- [ ] Error handling: errors don't leak internal state or credentials
- [ ] Dependency audit: new dependencies checked with pip-audit
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
<h1>Operator-Use</h1>
<p>
<a href="https://pypi.org/project/operator-use/"><img src="https://img.shields.io/pypi/v/operator-use" alt="PyPI"></a>
<a href="https://github.com/CursorTouch/Operator-Use/actions/workflows/ci.yml"><img src="https://github.com/CursorTouch/Operator-Use/actions/workflows/ci.yml/badge.svg" alt="CI"></a>
<a href="https://pepy.tech/project/operator-use"><img src="https://static.pepy.tech/badge/operator-use" alt="Downloads"></a>
<img src="https://img.shields.io/badge/python-≥3.12-blue" alt="Python">
<img src="https://img.shields.io/badge/license-MIT-green" alt="License">
Expand Down
Loading
Loading