35 lines
896 B
Markdown
35 lines
896 B
Markdown
# Output Safety
|
|
|
|
MCP results may be consumed by agents and therefore are an untrusted content channel.
|
|
|
|
## Required result envelope
|
|
|
|
Every tool result should provide structured data and metadata:
|
|
|
|
```json
|
|
{
|
|
"data": {},
|
|
"meta": {
|
|
"project": "...",
|
|
"environment": "...",
|
|
"source": "...",
|
|
"truncated": false,
|
|
"nextCursor": null,
|
|
"generatedAt": "..."
|
|
},
|
|
"warnings": []
|
|
}
|
|
```
|
|
|
|
## Rules
|
|
|
|
- mark truncation explicitly;
|
|
- never silently omit authorization failures;
|
|
- distinguish target unavailability from empty results;
|
|
- normalize control characters in logs;
|
|
- return plain text only when the contract requires it;
|
|
- cap nested depth and collection size;
|
|
- do not render untrusted HTML in the UI;
|
|
- resource descriptions and tool metadata come from managed manifests, not target content;
|
|
- include source identifiers so an agent can verify where information came from.
|