> ## Documentation Index
> Fetch the complete documentation index at: https://docs.framework.vibeworkapp.com/llms.txt
> Use this file to discover all available pages before exploring further.

# AgentConfig API

> Configuration builder methods for agents

## Basic Usage

```rust theme={null}
let config = AgentConfig::new("You are a helpful assistant")
    .with_tools(tools)
    .with_streaming(true);

let agent = StandardAgent::new(config, llm);
```

## Builder Methods

### with\_tools

```rust theme={null}
.with_tools(Arc<ToolRegistry>)
```

Set available tools for the agent.

### with\_streaming

```rust theme={null}
.with_streaming(bool)  // Default: true
```

Enable/disable streaming output.

### with\_debug

```rust theme={null}
.with_debug(bool)  // Default: false
```

Enable debug logging to `sessions/{session_id}/debugger/`.

### with\_thinking

```rust theme={null}
.with_thinking(u32)  // Budget in tokens
```

Enable extended thinking (Claude only). Budget: 8000, 16000, 32000, or 64000.

### with\_hooks

```rust theme={null}
.with_hooks(Arc<HookRegistry>)
```

Set behavior hooks.

### with\_hook\_short\_circuit

```rust theme={null}
.with_hook_short_circuit(bool)  // Default: false
```

Stop hook execution on first Deny.

### with\_max\_tool\_iterations

```rust theme={null}
.with_max_tool_iterations(usize)
```

Limit consecutive tool call loops.

### with\_auto\_save

```rust theme={null}
.with_auto_save(bool)  // Default: true
```

Auto-save session after each turn.

### with\_injection\_chain

```rust theme={null}
.with_injection_chain(InjectionChain)
```

Set context injection chain.

### with\_auto\_name

```rust theme={null}
.with_auto_name(bool)  // Default: true
```

Automatically name conversations after first turn.

### with\_naming\_llm

```rust theme={null}
.with_naming_llm(Arc<dyn LlmProvider>)
```

Use separate LLM for naming (e.g., faster/cheaper model).

### with\_prompt\_caching

```rust theme={null}
.with_prompt_caching(bool)  // Default: true
```

Enable/disable prompt caching.

### with\_dangerous\_skip\_permissions

```rust theme={null}
.with_dangerous_skip_permissions(bool)  // Default: false
```

Skip ALL permission checks. Use with security hooks.

## Complete Example

```rust theme={null}
let config = AgentConfig::new("You are a coding assistant")
    .with_tools(tools)
    .with_streaming(true)
    .with_debug(false)
    .with_thinking(16000)
    .with_hooks(hooks)
    .with_max_tool_iterations(10)
    .with_auto_save(true)
    .with_auto_name(true)
    .with_prompt_caching(true);
```
