Secure code execution platform with SafeRun security layer, Daytona isolation, and Anthropic Claude AI
Initium is a TypeScript-based platform that analyzes GitHub repositories, scans for security threats, generates deterministic execution plans using AI, and executes them securely in isolated Daytona workspaces.
- 🛡️ SafeRun Security Layer: 3-layer protection with PromptShield (30+ rules) + Claude AI analysis
- 🚫 Risk-Based Blocking: Automatically blocks High/Critical risk executions
- 🤖 AI-Powered Analysis: Uses Claude to analyze repositories and assess security risks
- 🔒 Security First: Non-root containers, network egress allowlists, memory caps, and timeouts
- 📊 Real-time Streaming: SSE-based log streaming with live execution updates
- 🎯 Deterministic Execution: No raw shell commands - only verified verbs (install, build, run, test)
- 🌐 Web UI: Modern Next.js interface for pasting repos and watching logs
- 🔗 Preview URLs: Automatic port exposure for web applications
- 📝 Comprehensive Audit Logs: Full security trail for all executions
apps/
├── api/ # Fastify backend
│ └── src/
│ ├── index.ts # Server entry point
│ ├── config.ts # Configuration management
│ ├── routes/
│ │ ├── plan.ts # POST /api/plan - Generate execution plan
│ │ ├── execute.ts # POST /api/execute - Execute plan
│ │ └── run.ts # GET /api/run/:id - Stream logs via SSE
│ └── lib/
│ ├── rules.ts # PromptShield security scanner (30+ rules)
│ ├── llmSecurity.ts # Claude AI security analysis
│ ├── daytona.ts # Daytona HTTP client wrapper
│ ├── planSchema.ts # Zod schema + security validation
│ ├── executor.ts # Deterministic step execution
│ ├── repo.ts # GitHub repository fetcher
│ └── llm.ts # Anthropic Claude integration
└── web/ # Next.js frontend
└── src/
└── app/
└── page.tsx # Main UI with form + log stream
Generate an execution plan from a GitHub repository URL.
Request:
{
"repoUrl": "https://github.com/remix-run/examples/tree/main/basic"
}Response:
{
"success": true,
"plan": {
"version": "1.0",
"name": "remix-basic",
"runtime": "node:20",
"steps": [
{ "name": "Install dependencies", "verb": "install" },
{ "name": "Build application", "verb": "build" },
{ "name": "Run application", "verb": "run" }
],
"ports": [3000]
},
"yaml": "version: '1.0'\nname: remix-basic\n..."
}Execute a plan in a Daytona workspace.
Request:
{
"repoUrl": "https://github.com/remix-run/examples/tree/main/basic",
"plan": { ... }
}Response:
{
"success": true,
"runId": "abc123",
"message": "Execution started"
}Stream execution logs via Server-Sent Events (SSE).
Response (SSE stream):
data: {"timestamp":"2024-01-01T00:00:00Z","level":"info","message":"Starting step: Install dependencies","step":"Install dependencies"}
data: {"timestamp":"2024-01-01T00:00:05Z","level":"success","message":"Step completed: Install dependencies"}
data: {"type":"complete","status":"success","previewUrl":"https://workspace-abc123.daytona.io"}
Plans are defined in YAML and validated with Zod:
version: "1.0"
name: my-app
runtime: node:20 # Docker image
steps:
- name: Install dependencies
verb: install
args: ["--frozen-lockfile"] # Optional
env: # Optional
NODE_ENV: production
workdir: /workspace/repo # Optional
timeout: 300000 # Optional (ms)
- name: Build application
verb: build
- name: Run application
verb: run
ports: [3000] # Optional
healthcheck: /health # Optional| Verb | Node.js | Python | Rust | Go |
|---|---|---|---|---|
install |
pnpm install |
pip install -r requirements.txt |
cargo fetch |
go mod download |
build |
npm run build |
❌ | cargo build --release |
go build |
run |
npm start |
python main.py |
cargo run --release |
go run . |
test |
npm test |
pytest |
cargo test |
go test ./... |
- Non-root execution: All containers run as
nonrootuser - Network egress allowlist: Only approved domains (GitHub, npm, etc.)
- Memory limits: Configurable max memory per workspace (default: 2GB)
- Timeouts: Per-step and global workspace timeouts
- Auto-cleanup: Workspaces destroyed after 30 minutes or on completion
- No raw shell: Only predefined verbs allowed - no arbitrary commands
- Node.js 20+
- pnpm 8+
- Daytona instance running (set
DAYTONA_BASE_URL) - Anthropic API key
- Clone the repository:
git clone <repo-url>
cd Dayton_Hack- Install dependencies:
pnpm install- Configure environment variables:
cp .env.example .env
# Edit .env with your API keysRequired environment variables:
ANTHROPIC_API_KEY=sk-ant-...
DAYTONA_BASE_URL=http://localhost:3986
PORT=3000
WORKSPACE_TIMEOUT_MS=1800000
MAX_MEMORY_MB=2048
ALLOWED_EGRESS_DOMAINS=github.com,npmjs.com,registry.npmjs.orgStart both API and web servers:
pnpm devThis will start:
- API server on http://localhost:3000
- Web UI on http://localhost:3001
Run unit tests:
pnpm testpnpm build
pnpm start- Open http://localhost:3001
- Paste a GitHub repository URL (e.g.,
https://github.com/remix-run/examples/tree/main/basic) - Click "Generate Plan" - Claude analyzes the repo and creates an execution plan
- Review the generated YAML plan
- Click "Execute Plan" - Initium creates a Daytona workspace and runs the steps
- Watch logs stream in real-time
- If the app exposes a port, you'll get a preview URL
- Paste GitHub repo URL → plan generated
- Execute plan → logs stream in real-time
- Preview URL displayed if port is bound
- Clear error messages if install/build fails
- Unit tests for plan schema validation
- Unit tests for executor verb mapper
- No raw shell commands in executor
- Timeouts and memory caps enforced
- Non-root user in containers
- Network egress allowlist
- Auto-destroy workspace on completion or timeout
- Backend: Fastify, TypeScript, Zod
- Frontend: Next.js 14, React, TailwindCSS
- AI: Anthropic Claude 3.5 Sonnet
- Infrastructure: Daytona workspaces
- Testing: Vitest
- Package Manager: pnpm
.
├── apps/
│ ├── api/ # Backend API
│ │ ├── src/
│ │ │ ├── index.ts
│ │ │ ├── config.ts
│ │ │ ├── routes/
│ │ │ └── lib/
│ │ ├── package.json
│ │ └── tsconfig.json
│ └── web/ # Frontend UI
│ ├── src/
│ │ └── app/
│ ├── package.json
│ └── tsconfig.json
├── package.json # Root package.json
├── pnpm-workspace.yaml # pnpm workspace config
├── tsconfig.json # Shared TypeScript config
├── .env.example # Environment variables template
└── README.md # This file
- Fork the repository
- Create a feature branch
- Make your changes
- Run tests:
pnpm test - Submit a pull request
MIT
For issues and questions, please open a GitHub issue.
Built with ❤️ for secure code execution