# Provenance and ContextRole

> Assign the trust semantics of the content you are compressing.

Keep untrusted retrieval, tool, and assistant content out of the protected priority tier.

Category: Core Concepts · Updated: September 2026 · 5 min read

## Roles

SYSTEM and DEVELOPER are trusted. USER is semi-trusted. ASSISTANT, TOOL, and RAG are untrusted: wording and preservation-pattern matches cannot move them above Tier 2 or make them must_keep. GENERAL is the legacy default.

```python
from llmslim import ContextRole, compress

result = compress(retrieved_text, context_role=ContextRole.RAG)
```

> **Trust boundary:** LLMSlim trusts caller-provided role labels and cannot authenticate provenance.

## FAQ

### Does ContextRole prevent prompt injection?

No. It mitigates compression-induced instruction elevation. Applications still need defense in depth.

### Can LLMSlim authenticate a role label?

No. The caller is responsible for accurate provenance.

## Related

- [Pipelines](https://www.llmslim.app/docs/pipelines.md)
- [Getting Started](https://www.llmslim.app/docs/getting-started.md)

Canonical page: https://www.llmslim.app/docs/context-role
