File size: 2,207 Bytes
ade765f
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
# CORTX Security Model

## Threat model

CORTX gives a language model the ability to rewrite its own operating rules.
The core risk: **the model (or a user manipulating the model via prompts)

escalates self-editing beyond policy text into something dangerous** β€” its
weights, its code, its identity, or credentials.

## Defense layers (all enforced in code, not prompt text)

1. **Whitelist** β€” only `constitution`, `tool_rules`, `metacognitive_rules`,
   `refusal_rules`, `playbook` are editable. Anything else is rejected.
2. **Locked sections** β€” `security_rules`, `identity`, `weights`, `code`,
   `admin_token`, `system_prompt` can never be edited through the channel.
   Attempts are rejected *and* logged.
3. **Size caps** β€” 8,000 chars/section, 8 edits/turn.
4. **Rate limit** β€” 40 edits per rolling hour. Violations blocked and logged.
5. **Hash-chained audit log** β€” every edit and every rejected attempt is
   appended as `hash = sha256(prev_hash + entry_json)`. Anyone can run
   `audit.verify()` to prove the log is untampered.
6. **Approval mode** β€” admin can require human sign-off before edits go live.
7. **Rollback** β€” config is version-pinned; admin restores any prior version.
8. **Isolation** β€” the edit channel reaches only policy-text files. It has no
   filesystem path capability, no code execution, no network access beyond the
   config repository. Weights, code, and tokens live in a different trust zone
   and are physically unreachable from the edit path.

## What the security model does NOT guarantee

- **Edit wisdom.** The boundary guarantees edits are *valid and bounded* β€” not
  that they are *good*. A small model can write worse rules than it started
  with. Review the audit log in production; that is why it exists.
- **Prompt-injection resistance of the base model.** The boundary is enforced
  in code, so no prompt can cross it β€” but the model's *content* remains its
  own responsibility.

## Verifying the audit log

```python

ok, n = editor.audit.verify()

assert ok, "audit log tampered at entry %s" % n

```

## Reporting

Security issues: open an issue on the repo or contact ChatPBC Labs.