YARA is the rule engine you reach for when an attacker’s pattern is well-defined and you want deterministic enforcement. Agnes manages YARA at two levels:Documentation Index
Fetch the complete documentation index at: https://docs.lasscyber.com/llms.txt
Use this file to discover all available pages before exploring further.
- YARA rules — individual
.yarrules, owned by a tenant. - YARA policies — named groupings of rules. The YARA analyzer targets a specific policy, so a single combined policy can swap rule sets per route, per product, or per traffic type.
The data model
A rule is independent of any policy. A policy is just a named ordered set of rule references. A rule can appear in many policies. Deleting a policy does not delete its rules.Authoring a rule
In the dashboard atagnes.lasscyber.com/protection/yara:
- Click New rule.
- Give it a unique name; the YARA rule body must declare the same
identifier (
rule MyRule: …). - Paste or write the rule. The editor validates compilation in-browser before save.
- Optionally toggle Active. Inactive rules are not compiled into any policy; useful for staging risky rules.
- Save.
- The first identifier after
rulemust match the rule’s name in Agnes’s database; the dashboard enforces this. - The
meta: category =value is what shows up as a termination signal under “Rule Category”. Reuse a stable set of categories (Injection,Secrets,Confidentiality,Brand, etc.) so policy authors can target a category instead of an explosion of rule names.
Generating rules from samples
The dashboard has a Generate from samples action that takes a list of example malicious texts and produces a starting YARA rule. It is a helper, not a substitute for review — always read the generated rule before activating it.Built-in rules
Agnes ships a handful of system-level rules underapi/data/yara/:
| Rule | Category | What it catches |
|---|---|---|
InstructionBypass | Instruction Bypass | ”Ignore previous instructions”, “Disregard the above…”, and dozens of paraphrases. |
GenericSecret | Secrets | High-entropy hex / base64 patterns suggestive of API keys. |
ApiTokens | Secrets | Common token shapes (Slack, GitHub, Stripe, etc.). |
SshKey | Secrets | OpenSSH / RSA private-key block headers. |
IpAddress | Network | IPv4 / IPv6 patterns. |
MarkdownExfiltration | Exfiltration | Markdown image-link tricks used for OOB data theft. |
FakeItMaintenance | Social Engineering | Common helpdesk-impersonation phrasings. |
SystemInstructions | Injection | Attempts to inject system: / assistant: role markers into a user prompt. |
React / ReactTxt | Format | Common React / JSX patterns. |
Guidance | Injection | Microsoft “guidance” template patterns used in some attacks. |
Extortion | Threats | Extortion / blackmail patterns. |
Authoring a YARA policy
In the dashboard atagnes.lasscyber.com/protection/yara-policies:
- Click New policy.
- Give it a name and (optional) description.
- Add rules to the policy in the order you want them evaluated.
- Optionally mark as the tenant default YARA policy. The default
is used by the YARA analyzer when no
yara_policy_idis set. - Save.
- Inbound base — the system instruction-bypass rules + your own product-specific injections.
- Outbound base — the secrets and exfiltration rules + your internal codenames.
- High-risk surface — every rule, even noisy ones; pair with a
combined policy that treats
matches_found > 0as a block.
Wiring it into a combined policy
The YARA analyzer takes ayara_policy_id parameter:
Permissions
| Role | Read | Create / update | Delete |
|---|---|---|---|
| Owner | Yes | Yes | Yes |
| Admin | Yes | Yes | Yes |
| Member | Yes | Yes | Yes |
| Viewer | Yes | No | No |
yara:* scope family. See
Roles & permissions.
Limits and gotchas
- Compilation cache. Agnes compiles the policy on first use and caches it per tenant + policy. Adding or disabling a rule clears the cache lazily; the next request after the change recompiles.
- Quoting. YARA strings use
/regex/-style literals or double-quoted strings. Test rules locally with the official YARA CLI when uncertain. - Performance. A few hundred well-written rules is fine; tens of thousands of overlapping regex rules will measurably degrade latency. Group, don’t duplicate.
Next
- YARA analyzer — runtime metrics, termination signals, and latency.
- Combined analyzer — wire the YARA policy into termination rules.