LSP AI Operator Guide¶
This guide describes how to operate AI-assisted features in dsdld safely.
1. Scope¶
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
ai-data-flow.md.
Relevant code:
include/llvmdsdl/LSP/AI.hlib/LSP/AI.cppinclude/llvmdsdl/LSP/ServerConfig.hlib/LSP/Server.cpp
2. AI Modes¶
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.
3. Safety Controls¶
Implemented controls:
- Mode gate (
AiPolicyGate) determines allowed behaviours. - 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
4. Configuration¶
Via workspace/didChangeConfiguration:
{
"settings": {
"ai": {
"mode": "suggest"
}
}
}
VS Code equivalents:
dsdld.aiMode
5. Operational Playbooks¶
5.1 Conservative default¶
- Set
aiModetoofforsuggest. - Keep lint enabled for deterministic static checks.
- Review all code actions before applying.
5.2 Controlled edit application¶
- Set
aiModetoapply_with_confirmation. - Require explicit user confirmation for each AI edit resolution.
- Keep normal PR/code-review gates unchanged.
5.3 Incident response¶
If suspicious AI behaviour is observed:
- Set
aiModetooffimmediately. - Capture
dsdld/debug/aiAuditLogoutput. - Reproduce with minimal fixture and add a unit test.
- File fix and document behaviour change.
6. Auditing¶
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).
7. Current Limitations¶
- 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.
8. Release Gate Expectations¶
Before release, verify:
- Mode gating tests pass.
- Confirmation gate behaviour passes.
- Tool allow-list rejects unsupported tools.
- Redaction tests pass.
docs/reference/lsp/ai-operation.mdmatches current behaviour.