ShellConfig

org.llm4s.toolapi.builtin.shell.ShellConfig
See theShellConfig companion class
object ShellConfig

Attributes

Companion
class
Graph
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type

Members list

Type members

Inherited and Abstract types

type MirroredElemLabels <: Tuple

The names of the product elements

The names of the product elements

Attributes

Inherited from:
Mirror
type MirroredLabel <: String

The name of the type

The name of the type

Attributes

Inherited from:
Mirror

Value members

Concrete methods

def development(workingDirectory: Option[String]): ShellConfig

Create a development shell configuration with common dev tools.

Create a development shell configuration with common dev tools.

'''This is not a sandbox.''' Build tools (sbt, make, npm, gradle, ...), git, find -exec and env run arbitrary programs by design, so a model given this configuration can run anything the process can. Use readOnly, or a list of your own, for anything less trusted. Commands inherit the whole process environment, which the build tools need.

Attributes

def readOnly(workingDirectory: Option[String]): ShellConfig

Create a read-only shell configuration that allows common read-only commands.

Create a read-only shell configuration that allows common read-only commands.

'''Files are not contained.''' The commands may read any file the process can read, whatever the file tools are configured to allow; use readOnlyWithin to hold their arguments to a path policy. The command's environment is scrubbed (see ShellConfig).

The programs on this list are ones whose ordinary use only reads, but this is an allowlist of program names, not read-only execution: most options pass through unchecked, so date -s sets the clock when the process may. The options that write a file, run a program or read one the command does not name are refused in every spelling (file -C, -m, -M, -f, date -f, -r, wc --files0-from, and for an allowlist that adds sort, sort -o, -T, --compress-program and --files0-from; see "Refused options" in the class documentation). env is deliberately absent: with arguments it runs the program that follows it (env sh -c ...), so allowing it allows every program, and without them it prints the process environment, which is where API keys live. The allowlist checks the program a command starts with, not the programs that program starts - keep that in mind before adding a launcher such as env, xargs, nice, timeout or nohup. file runs with its flags that write a file or read a list of files (-C, -m, -M, -f) refused.

Attributes

def readOnlyWithin(policy: FileConfig, workingDirectory: Option[String]): ShellConfig

Like readOnly, with the file-like arguments of every command held to policy (its isPathAllowed, with a .. after a link read both as POSIX and as Windows applies it; see ShellConfig). This is the configuration to give a model that can read untrusted content: with plain readOnly, cat reads any file the process can read.

Like readOnly, with the file-like arguments of every command held to policy (its isPathAllowed, with a .. after a link read both as POSIX and as Windows applies it; see ShellConfig). This is the configuration to give a model that can read untrusted content: with plain readOnly, cat reads any file the process can read.

Attributes

Concrete fields

val DefaultInheritedEnvironment: Seq[String]

The process variables a command receives unless inheritedEnvironment says otherwise.

The process variables a command receives unless inheritedEnvironment says otherwise.

Attributes