This guide describes how to operate AI-assisted features in dsdld safely.
AI support in dsdld is optional and policy-gated.
The default provider is deterministic and offline (OfflineAiProvider).
For what data enters the AI surface, what leaves it, and what is retained — including the bounds on
how much source can reach the provider and why nothing is transmitted off the machine — see
LSP_AI_DATA_FLOW.md.
Relevant code:
include/llvmdsdl/LSP/AI.hlib/LSP/AI.cppinclude/llvmdsdl/LSP/ServerConfig.hlib/LSP/Server.cpp
Supported modes:
off: AI disabled.suggest: non-edit suggestions and explanations.assist: richer suggestions and optional confirmation-required edit proposals.apply_with_confirmation: allows edit materialization only with explicit confirmation.
Recommended default for shared repos:
offfor conservative posture.suggestfor low-risk advisory usage.
Implemented controls:
- Mode gate (
AiPolicyGate) determines allowed behaviors. - Confirmed edits only in
apply_with_confirmation. - Tool-use allow-list blocks unapproved operations.
- Context packing is bounded in size.
- Audit records are redacted before storage.
Allowed tool-use names today:
analysis.statsworkspace.symbolsdocument.symbolsdocument.diagnostics
Via workspace/didChangeConfiguration:
{
"settings": {
"ai": {
"mode": "suggest"
}
}
}VS Code equivalents:
dsdld.aiMode
- Set
aiModetoofforsuggest. - Keep lint enabled for deterministic static checks.
- Review all code actions before applying.
- Set
aiModetoapply_with_confirmation. - Require explicit user confirmation for each AI edit resolution.
- Keep normal PR/code-review gates unchanged.
If suspicious AI behavior is observed:
- Set
aiModetooffimmediately. - Capture
dsdld/debug/aiAuditLogoutput. - Reproduce with minimal fixture and add a unit test.
- File fix and document behavior change.
Audit retrieval endpoint:
dsdld/debug/aiAuditLog
Redaction currently masks common secret patterns including:
passwordtokensecretapi_key/api-keyBearer <token>
Audit logs are bounded in memory (MaxRecords).
- Provider is offline/deterministic and does not call external model APIs yet.
- No persistent on-disk audit sink is implemented yet.
- Tool-use surface is intentionally narrow.
Before release, verify:
- Mode gating tests pass.
- Confirmation gate behavior passes.
- Tool allow-list rejects unsupported tools.
- Redaction tests pass.
docs/LSP_AI_OPERATOR_GUIDE.mdmatches current behavior.