# Class LittleGhost::CodeMode::RubyEngine

Documentation version: Edge

Canonical HTML: https://littleghostai.org/docs/LittleGhost/CodeMode/RubyEngine.html

Runs model-written Ruby in a fresh sandboxed process.

Tool calls cross a bounded protocol to the trusted parent Broker. The engine
uses only Ruby's standard library and adds no runtime dependency.

    LittleGhost.configure do |config|
      config.code_mode = {engine: :ruby, sandbox: :native}
    end

## Inheritance

`LittleGhost::CodeMode::RubyEngine < LittleGhost::CodeMode::Engine`

## Constants

### `DEFAULT_LIMITS`

Resource, Tool-call, and program limits applied when the application does not
override them.

## Instance methods

<a id="method-i-instructions"></a>
### `#instructions`

```ruby
#instructions(catalog:)
```

Builds Ruby usage instructions and method declarations for `catalog`.

<a id="method-i-language"></a>
### `#language`

```ruby
#language()
```

Returns the `:ruby` language identifier.

<a id="method-i-open_session"></a>
### `#open_session`

```ruby
#open_session(broker:, sandbox_factory:, limits: {})
```

Opens a Ruby Session with engine defaults merged with `limits`. Unsupported
limit keys raise ArgumentError.
