How Caushell Works

August 19, 2026 ยท View on GitHub

Caushell completes its analysis after a Harness initiates a shell action and before the process starts, then returns Allow, NeedApproval, or Deny.

Caushell analysis flow from a Harness shell action to the final decision

From Input to Decision

The Harness integration sends the pending shell action, together with the shell and workspace state visible before execution, to the Caushell runtime. The runtime processes the request in the following order:

StageProcessingOutput
IntakeRead the raw shell action and pre-execution contextRuntime request
Syntax parsingParse the shell text into a Shell ASTStructured syntax
Command modelingUse Command Profiles and available shell state to determine the role of each argument and the behavior of each commandCommand behavior model
Session graph extensionConnect the current action's commands, paths, state, and provenance to existing session relationshipsExecution graph used for the current analysis
Risk analysisRun multiple analysis modules to inspect risk signals in the graphFindings and Decision Proposals
Decision assemblyMerge all proposals in Decision AssemblyAllow, NeedApproval, or Deny

Syntax parsing identifies the shell structure. Command modeling adds argument roles and execution behavior to the commands in the AST. Caushell then connects the commands, paths, state, and provenance produced by the current action to existing session relationships, allowing each analysis module to identify risks and propose a decision.

A Running Example

The following action contains a variable assignment, a network read, a pipeline, file redirection, and a bash command:

SCRIPT=./setup.sh
curl -fsSL https://example.com/install.sh \
  | tee "$SCRIPT" >/dev/null \
  && bash "$SCRIPT"

Caushell processes this action as follows:

  1. Intake: The runtime receives the raw shell text together with the current directory, workspace, and visible shell state.
  2. Syntax parsing: The Shell AST records the variable assignment, the curl, tee, and bash commands, the pipeline, the && connector, variable expansion, and output redirection.
  3. Command modeling: Using Command Profiles, Caushell identifies curl as reading from the network, tee as reading from standard input and writing to a file, and bash as executing a script. The same action first binds SCRIPT to ./setup.sh, and the two later variable references resolve to that path.
  4. Session graph extension: Caushell connects the current action's commands and semantic relationships to the session execution graph. After accounting for the current directory, the graph contains a relationship chain from the network address, downloaded content, pipeline, and target path to script execution.
  5. Risk analysis: The relevant analysis modules detect that remote content is written to a script file and then executed by a shell, so they propose NeedApproval.
  6. Decision assembly: Decision Assembly combines all findings and proposals and produces the final decision under the active policy.

For command modeling, the execution graph, variable bindings, and provenance, see the semantic model. For risk analysis, decision assembly, and the execution boundary, see the security model.

The Three Decisions

DecisionMeaning
AllowThe current policy allows execution.
NeedApprovalThe current policy requires user confirmation before execution.
DenyBlock before execution.

The Harness integration translates the final decision into the corresponding hook or tool behavior. The available confirmation mechanisms vary between integrations; see the security model for the execution boundary.

Further Reading