A highly constrained, JSONL-based execution language for LLMs. (Note: Not intended for human developers to write by hand)
caslang replaces multi-step LLM tool calls with a single, deterministically validated script to achieve two core objectives:
- Minimize Hallucinations: Single-pass generation in a strict format reduces LLM errors.
- Security Validation: Pre-execution schema checks guarantee safe host behavior.
We use JSONL (JSON Lines) as our standard script format. Each line in a caslang script is a valid JSON object representing a single command. This makes it highly LLM-friendly, easily parsable, and machine-validated.
An LLM can generate this entire plan to execute a semantic search over a SQL database, without escaping multiline strings:
{"op":"caslang","version":"0.3"}
{"op":"flow.set","name":"target","value":"a red car driving in the rain"}
{"op":"flow.set","name":"query","mode":"block","nonce":"__SQL__"}
SELECT image_id, device_id, timestamp
FROM VisionDB
WHERE object_class = 'car' AND confidence > 0.85
ORDER BY timestamp DESC LIMIT 1000
{"op":"flow.end_set","name":"query","nonce":"__SQL__"}
{"op":"tool.call","tool_name":"semantic_search","target_text":"${target}","filter_sql":"${query}","as":"results"}
{"op":"flow.return","value":"${results}"}caslang isn't just for backend tool calls—it can safely orchestrate local file operations to generate reports or process data on the host machine:
{"op":"caslang","version":"0.3"}
{"op":"fs.list","dir":"/data/results","pattern":"*.json","as":"files"}
{"op":"flow.set","name":"html","value":"<h1>Analysis Report</h1>"}
{"op":"flow.loop_start","var":"file","in":"${files}"}
{"op":"fs.read_file","path":"${file}","as":"raw"}
{"op":"json.parse","s":"${raw}","as":"data"}
{"op":"flow.set","name":"html","value":"${html}<p>${data['summary']}</p>"}
{"op":"flow.loop_end"}
{"op":"fs.write_file","path":"/data/report.html","data":"${html}"}
{"op":"str.print","msg":"Report generated successfully!"}- Single-pass execution: One script, one validation, one execution. Reduces latency and hallucination risks.
- Privacy by default: Execution happens locally. Local data stays local.
- Strong constraints: Strict argument schemas and a closed command set.
- Separation of concerns: The language defines control, capabilities define what exists, and the executor defines how it runs.
caslang is:
- A machine-to-machine execution format generated by AI models.
- LLM-friendly, machine-validated, and host-embedded.
caslang is not:
- A language intended for human developers to write manually.
- A general-purpose programming language.
- An agent framework or chat protocol.