Skip to main content

The Constants Primitives

Constants provides a complete system for generating tools with AI from scripts and prompts. Here are the core primitives:

Tool

Spec + entrypoint — a standardized execution unit with explicit inputs/outputs

Version (SHA)

Pinned provenance of code + spec for reproducibility

Run

Inputs, status, logs, timing, cost — full execution record

Artifacts

Outputs from runs: files, tables, reports, models

Core Features

Tool: Spec + Entrypoint

A Tool is a standardized execution unit with:
  • Explicit inputs and outputs — Typed schemas that define what goes in and what comes out
  • Governed runtime — CPU, memory, timeout, and permission boundaries
  • Deterministic execution — Same inputs produce same outputs
  • Version pinning — Locked to a specific SHA for reproducibility
https://github.com/your-org/scripts/blob/main/process_data.py
Constants clones the repo, analyzes the script, and generates the Tool spec automatically.

Version: Pinned Provenance

Every Tool is pinned to a specific version:
  • Git SHA for GitHub imports — exact code snapshot
  • Content hash for uploaded scripts — deterministic identifier
  • Spec version — the input/output contract at that point in time
This ensures:
  • Reproducibility — Run the same code months later
  • Auditability — Know exactly what ran and when
  • Stability — Source changes don’t break running Tools

Run: Complete Execution Record

Every execution produces a Run with:
FieldDescription
InputsThe exact parameters and files provided
StatusRunning, completed, failed, cancelled
LogsReal-time stdout/stderr capture
TimingStart time, duration, resource usage
CostCompute resources consumed
Runs are the product — reproducible execution with full auditability.

Artifacts: Execution Outputs

Tools produce Artifacts:
  • Files — CSVs, PDFs, images, models
  • Data — JSON responses, structured outputs
  • Reports — Generated visualizations and summaries
Artifacts are:
  • Downloadable from the UI
  • Accessible via the API
  • Linked to their originating Run

Governance Layer

Policy: Permissions & Resources

Define who can run what, with which resources:
  • Owner — Full control over the Tool
  • Editor — Can modify settings and run
  • Runner — Can execute but not modify
  • Viewer — Can see runs but not execute
  • API keys and credentials stored encrypted
  • Injected at runtime as environment variables
  • Scoped per-Tool — receivers never see values
  • Audit log of secret access
  • CPU: 1-4 cores
  • Memory: 512MB - 4GB
  • Timeout: 30s - 30min
  • Network: Allow/deny external access

Sandbox: Isolated Execution

Every Tool runs in a governed sandbox:
  • Isolated runtime — Each execution in its own container
  • Resource boundaries — CPU/memory limits enforced
  • Network controls — External access explicitly granted
  • Filesystem isolation — No access to host system
  • Clean slate — Fresh environment for each run

Interfaces

Generated UI

Every Tool gets a generated UI:
  • Form inputs based on the input schema
  • File upload for file-type inputs
  • Real-time log streaming
  • Artifact download buttons
  • Run history viewer
Share a link — recipients can run tools without any local setup.

API Access

Tools are also accessible programmatically via the REST API for automation and integration into existing workflows. See the API Reference for details.

What a Tool Guarantees

GuaranteeDescription
Verified ExecutionRuns real code, not approximations or guesses
Governed SandboxIsolated runtime with resource/permission boundaries
Observable + ReplayableLogs, artifacts, history, and reruns
ReproduciblePinned to SHA with deterministic semantics
ShareableAnyone with the link can run it — no setup required

File Handling

Upload and process files in your Tools:
  • Scripts: .py, .js, .ts, .sh, .sql
  • Data: .csv, .json, .xml, .yaml
  • Documents: .pdf, .docx, .txt, .md
  • Images: .png, .jpg, .gif, .webp
  • Spreadsheets: .xls, .xlsx
File size limits apply based on your plan. Large file handling is available for enterprise accounts.

Conversation Mode

Interact with your Tools through natural language:
  • Ask questions about run results
  • Request modifications to the Tool
  • Debug failed runs conversationally
  • Get explanations of what the code does

What’s Next?

GitHub Integration

Import scripts from repositories

API Reference

Programmatic access for automation