The C# SDK keeps configuration close to the Autohand CLI contract. Most options become CLI flags when the subprocess starts.
var options = new AgentOptions
{
WorkingDirectory = ".",
Model = "fantail2",
Skills = new[] { "csharp", "testing" },
Instructions = "Prefer safe, idiomatic C#.",
};CliPath can be set directly or with AUTOHAND_CLI_PATH in examples.
Provider credentials are owned by the Autohand CLI, not the SDK. Configure them in ~/.autohand/config.json or through environment variables supported by the CLI.
{
"provider": "openrouter",
"openrouter": {
"apiKey": "sk-or-...",
"model": "openrouter/auto"
}
}Common options:
Model: model override.Temperature: sampling temperature.MaxIterations: loop limit.MaxRuntimeMinutes: wall-clock limit.MaxCost: cost budget.ContextCompact: context compaction.AdditionalDirectories: extra workspace roots.Skills: skills available to the agent.Environment: environment variables for the CLI subprocess.
Use AgentOptions.Instructions or AppendSystemPrompt for normal integrations. Replacing SystemPrompt means your host owns the full agent contract.
Use Unrestricted only for trusted automation. For most applications, keep the default interactive behavior and respond to PermissionRequestEvent.
await sdk.SetPermissionModeAsync("interactive");Plan mode is a runtime control:
await sdk.SetPlanModeAsync(true);See Plan Mode.