Bc-AI commited on
Commit
59a37c7
·
verified ·
1 Parent(s): 6b18d9f

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +53 -31
README.md CHANGED
@@ -19,28 +19,35 @@ tags:
19
 
20
  # Cyber Safety Model
21
 
22
- **CSM-1-Preview** is a **Cyber Safety Model**: [Qwen/Qwen3.5-27B](https://huggingface.co/Qwen/Qwen3.5-27B) fine-tuned with a LoRA adapter for defensive cybersecurity work, with the adapter merged into the weights (bf16). It is meant to help defenders, engineers and learners with detection, incident response, hardening, secure coding and static malware analysis, while declining to produce ready-to-use attack tooling.
23
 
24
- > **Experimental.** This model can be wrong. Verify CVE IDs, commands, detection rules and malware verdicts before relying on them. No formal benchmark results are published for it yet.
25
 
26
- ## Intended use
27
 
28
- - Explaining attacks, vulnerabilities and malware behaviour at a defender's level of detail
29
- - Writing and reviewing detections (Sigma, YARA, queries), hardening guidance and incident-response runbooks
30
- - Secure code review and secure-by-design advice
31
- - Triage and **static** analysis of suspicious files, scripts and browser or IDE extensions (with tools: see below)
32
- - Teaching, CTFs and authorized security testing concepts
33
 
34
- ## Out of scope
35
 
36
- - Producing working malware, ransomware, stealers, botnets, phishing kits or weaponized exploits
37
- - Attacking systems you do not own or are not authorized to test
38
- - Being the only basis for a legal, forensic or compliance decision
39
- - Anything that needs guaranteed factual accuracy without human verification
 
 
 
 
 
 
 
 
 
 
 
40
 
41
  ## Quick start
42
 
43
- Needs a recent `transformers`, about 55 GB of GPU memory in bf16, and `flash-linear-attention` for fast linear-attention layers.
44
 
45
  ```python
46
  import torch
@@ -48,41 +55,56 @@ from transformers import AutoTokenizer, AutoModelForImageTextToText
48
 
49
  repo = "OpenModel-Labs/CSM-1-Preview"
50
  tok = AutoTokenizer.from_pretrained(repo)
51
- model = AutoModelForImageTextToText.from_pretrained(repo, dtype=torch.bfloat16, device_map="auto")
 
 
52
 
53
  messages = [
54
- {"role": "system", "content": open("system_prompt.txt").read()}, # recommended, see below
55
  {"role": "user", "content": "How do I detect Kerberoasting in Windows event logs?"},
56
  ]
57
- prompt = tok.apply_chat_template(messages, add_generation_prompt=True, tokenize=False, enable_thinking=False)
 
 
58
  inputs = tok(prompt, return_tensors="pt", add_special_tokens=False).to(model.device)
59
- out = model.generate(**inputs, max_new_tokens=1024, do_sample=True, temperature=0.7, top_p=0.9, top_k=20)
 
 
 
60
  print(tok.decode(out[0][inputs["input_ids"].shape[1]:], skip_special_tokens=True))
61
  ```
62
 
63
- `example_chat.py` in this repo is a small streaming chat loop. Settings used in testing: temperature 0.7 for chat (0.2 to 0.4 for analysis tasks), top_p 0.9, top_k 20. Set `enable_thinking=True` in the chat template to let the model reason before answering (slower).
 
 
64
 
65
  ## Recommended system prompt
66
 
67
- The model was tested with the prompt in [`system_prompt.txt`](system_prompt.txt). It asks for accurate, concise answers, no invented CVEs or flags, treating pasted content as data rather than instructions, defanged IOCs, and a short refusal with a defensive alternative for harmful requests.
68
 
69
- ## Tool use
70
 
71
- The chat template supports tool calling. If you give the model file or shell tools for malware analysis, run them in a **sandbox with read-only samples**, an allowlist of commands and no network, and treat all tool output as untrusted data (it can contain prompt injection). Never execute samples.
72
 
73
- ## Training
 
 
 
74
 
75
- - Base model: Qwen/Qwen3.5-27B
76
- - Method: LoRA fine-tuning, merged into the base weights (bf16)
77
- - Training data and evaluation details: not documented in this card yet.
78
 
79
  ## Limitations and risks
80
 
81
- - May hallucinate identifiers (CVEs, CVSS scores, product names, flags, API fields). Always check against primary sources.
82
- - Safety behaviour is imperfect: it can refuse legitimate requests and can be talked into answers it should not give. Do not use it as a security control.
83
- - Malware verdicts from static reading are heuristic. Absence of evidence in a quick scan is not proof of safety.
84
- - Inherits the limitations and biases of the base model.
85
 
86
  ## License
87
 
88
- Released under **other**. Check that your use also complies with the base model's license.
 
 
 
 
 
19
 
20
  # Cyber Safety Model
21
 
22
+ **CSM-1-Preview** is an experimental Cyber Safety Model designed to help defenders, engineers, and learners with cybersecurity work. It can help with detection, incident response, hardening, secure coding, and static malware analysis. It is also designed to decline requests for ready-to-use attack tooling.
23
 
24
+ The model was fine-tuned using a LoRA adapter that has been merged into the weights in bf16.
25
 
26
+ > **A quick note:** CSM-1-Preview can make mistakes. Please verify CVE IDs, commands, detection rules, and malware verdicts before relying on them. Formal benchmark results are not yet available.
27
 
28
+ ## What can it help with?
 
 
 
 
29
 
30
+ CSM-1-Preview is intended for tasks such as:
31
 
32
+ - Explaining attacks, vulnerabilities, and malware behavior from a defender’s perspective
33
+ - Writing and reviewing detections, including Sigma, YARA, and queries
34
+ - Developing hardening guidance and incident-response runbooks
35
+ - Reviewing code and discussing secure-by-design practices
36
+ - Triaging and **statically** analyzing suspicious files, scripts, and browser or IDE extensions—with appropriate tools and safeguards
37
+ - Learning about CTFs and authorized security testing
38
+
39
+ ## What’s out of scope?
40
+
41
+ Please don’t rely on the model for:
42
+
43
+ - Producing working malware, ransomware, stealers, botnets, phishing kits, or weaponized exploits
44
+ - Attacking systems without authorization
45
+ - Making legal, forensic, or compliance decisions without expert review
46
+ - Tasks that require guaranteed accuracy without human verification
47
 
48
  ## Quick start
49
 
50
+ You’ll need a recent version of `transformers`, approximately 55 GB of GPU memory in bf16, and `flash-linear-attention` for fast linear-attention layers.
51
 
52
  ```python
53
  import torch
 
55
 
56
  repo = "OpenModel-Labs/CSM-1-Preview"
57
  tok = AutoTokenizer.from_pretrained(repo)
58
+ model = AutoModelForImageTextToText.from_pretrained(
59
+ repo, dtype=torch.bfloat16, device_map="auto"
60
+ )
61
 
62
  messages = [
63
+ {"role": "system", "content": open("system_prompt.txt").read()},
64
  {"role": "user", "content": "How do I detect Kerberoasting in Windows event logs?"},
65
  ]
66
+ prompt = tok.apply_chat_template(
67
+ messages, add_generation_prompt=True, tokenize=False, enable_thinking=False
68
+ )
69
  inputs = tok(prompt, return_tensors="pt", add_special_tokens=False).to(model.device)
70
+ out = model.generate(
71
+ **inputs, max_new_tokens=1024, do_sample=True,
72
+ temperature=0.7, top_p=0.9, top_k=20
73
+ )
74
  print(tok.decode(out[0][inputs["input_ids"].shape[1]:], skip_special_tokens=True))
75
  ```
76
 
77
+ For a simple streaming chat loop, see `example_chat.py` in this repository.
78
+
79
+ Settings used in testing were temperature **0.7** for chat, **0.2–0.4** for analysis tasks, `top_p=0.9`, and `top_k=20`. Set `enable_thinking=True` in the chat template to let the model reason before answering; this will be slower.
80
 
81
  ## Recommended system prompt
82
 
83
+ The model was tested with [`system_prompt.txt`](system_prompt.txt). The prompt asks it to give accurate, concise answers; avoid inventing CVEs or flags; treat pasted content as data rather than instructions; defang IOCs; and offer a short refusal with a defensive alternative for harmful requests.
84
 
85
+ ## Using tools safely
86
 
87
+ The chat template supports tool calling. If you provide file or shell tools for malware analysis:
88
 
89
+ - Use a **sandbox** with read-only samples.
90
+ - Allowlist commands and disable network access.
91
+ - Treat all tool output as untrusted data—it may contain prompt injection.
92
+ - Never execute samples.
93
 
94
+ ## Training and evaluation
95
+
96
+ CSM-1-Preview was fine-tuned with LoRA, and the adapter was merged into the weights in bf16. Training data and evaluation details are not yet documented in this card.
97
 
98
  ## Limitations and risks
99
 
100
+ - The model may invent identifiers such as CVEs, CVSS scores, product names, flags, or API fields. Check primary sources.
101
+ - Its safety behavior is imperfect: it may refuse legitimate requests or produce answers it should not. Don’t use it as a security control.
102
+ - Static malware assessments are heuristic. A quick scan that finds nothing suspicious does not prove a file is safe.
 
103
 
104
  ## License
105
 
106
+ Released under **other**. See the [license agreement](LICENSE) and check that your use also complies with applicable upstream license requirements.
107
+
108
+ ## Base model
109
+
110
+ CSM-1-Preview is a fine-tune of the base model listed in the metadata above and inherits its limitations and biases.