Instructions to use Sykeclonex/intentlock-tiny-aya-guard with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- PEFT
How to use Sykeclonex/intentlock-tiny-aya-guard with PEFT:
from peft import PeftModel from transformers import AutoModelForCausalLM base_model = AutoModelForCausalLM.from_pretrained("CohereLabs/tiny-aya-global") model = PeftModel.from_pretrained(base_model, "Sykeclonex/intentlock-tiny-aya-guard") - Notebooks
- Google Colab
- Kaggle
File size: 3,301 Bytes
241505f 2518156 241505f 2518156 241505f 2518156 | 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 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 | ---
license: cc-by-nc-4.0
base_model: CohereLabs/tiny-aya-global
library_name: peft
tags: [lora, ai-safety, prompt-injection, agents, safetune, lexsi-hackathon]
datasets: [Sykeclonex/intentlock-scenarios]
---
# Intentlock: pre-signing guard
Tiny Aya classifier that reads the user's task, recent tool outputs and a proposed transaction payload, and answers `ALLOW: reason` or `BLOCK: reason`.
LoRA adapter for [`CohereLabs/tiny-aya-global`](https://huggingface.co/CohereLabs/tiny-aya-global), built for **Intentlock** (Lexsi AI
Safety and Alignment Hackathon, Track 2). Code and full results:
<https://github.com/davieslennox0/intentlock>.
## Training
Plain SFT on proposed actions from the `train` split: reference safe/compromised trajectories, baseline-agent traces, and up-weighted legitimate large actions.
```json
{
"method": "plain",
"args": {
"model": "CohereLabs/tiny-aya-global",
"method": "plain",
"data": "data/sft/guard_train.jsonl",
"val": "data/sft/guard_val.jsonl",
"out": "outputs/guard",
"epochs": 2.0,
"batch_size": 1,
"lr": 0.0001,
"lora_r": 16,
"lora_alpha": 32,
"max_len": 1024,
"grad_accum": 16,
"longest_first": false,
"max_steps": -1,
"amp": "auto",
"time_budget_min": 200.0,
"rho": 0.1,
"safety_n": 256,
"kl_reference": false,
"load_in_4bit": true,
"no_grad_checkpointing": false,
"max_rows": null,
"seed": 7,
"push": null
},
"train_rows": 1146,
"length_cap": {
"data/sft/guard_train.jsonl": {
"rows_in": 1146,
"dropped_over_max_len": 0,
"max_len": 1024,
"longest_row_tokens": 880
},
"data/sft/guard_val.jsonl": {
"rows_in": 127,
"dropped_over_max_len": 0,
"max_len": 1024,
"longest_row_tokens": 876
}
},
"grad_accum_used": 16,
"effective_batch": 16,
"amp": "fp16",
"planned_steps": 143,
"stopped_by_time_budget": false,
"seconds_per_step": 37.01,
"steps": 144,
"lora": {
"r": 16,
"alpha": 32,
"dropout": 0.05,
"target_modules": [
"q_proj",
"k_proj",
"v_proj",
"o_proj",
"gate_proj",
"up_proj",
"down_proj"
]
},
"val_rows": 127,
"safety_set": null,
"train_loss": 0.27348066264918697,
"wall_seconds": 5328.8,
"final_eval_loss": 0.0021436812821775675,
"versions": {
"safetune": "0.1.12",
"transformers": "5.20.2",
"torch": "2.11.0+cu130",
"python": "3.13.16"
},
"gpu": "Tesla T4",
"peak_gpu_memory_gb": 7.79
}
```
## Use
```python
from peft import PeftModel
from transformers import AutoModelForCausalLM, AutoTokenizer
tok = AutoTokenizer.from_pretrained("CohereLabs/tiny-aya-global")
model = PeftModel.from_pretrained(AutoModelForCausalLM.from_pretrained("CohereLabs/tiny-aya-global"), "Sykeclonex/intentlock-tiny-aya-guard")
```
The prompt format (system prompt, strict-JSON actions, boundary tags) is in `testbed/prompts.py`
and `training/guard.py` of the GitHub repository; the adapter expects that format.
## Limits
Trained and evaluated on synthetic scenarios with mock tools. It reduces injection-following on that
distribution; it is not a guarantee against real attackers and must not be the only control in front
of real funds. Inherits Tiny Aya's CC-BY-NC-4.0 licence.
|