Skip to content

Quickstart Guide

Get up and running with ctxsec in under 2 minutes.


1. Installation

One-Line Install Script

curl -fsSL https://ctxsec.io/install.sh | sh

From Source (Go 1.24+)

git clone https://github.com/gosecio/ctxsec.git
cd ctxsec
CGO_ENABLED=0 go build -o bin/ctx ./cmd/ctx
sudo mv bin/ctx /usr/local/bin/ctx

Verify installation:

ctx version


2. Initialize in Your Workspace

Run ctx init inside any repository to automatically detect your AI development environment (Antigravity, Cursor, Claude, or VS Code):

cd /path/to/my-project
ctx init

This generates: - ctxsec.yaml: Project policy rules and role definitions. - .agents/hooks.json: Lifecycle hook adapter for Antigravity and Claude Code.


3. Verify Local Kernel Sandbox

Test that ctxsec can enforce in-kernel isolation on your operating system:

# Inspect sandbox detection
ctx sandbox inspect

# Test a simulated sandboxed command
ctx exec --role=researcher -- bash -c "touch /tmp/malicious.txt"

Output:

[ctxsec:kernel] Enforcing Apple Seatbelt SBPL profile for role: researcher
touch: /tmp/malicious.txt: Operation not permitted
[ctxsec] Hardware syscall blocked: EPERM


4. Evaluate Security Policies

Run policy evaluations locally:

ctx policy check --facts facts.json

Next Steps