This guide presents a systematic approach to creating dynamic, context-aware prompt injection systems in SillyTavern using World Info entries, outlets, and regex triggers. The techniques described enable sophisticated narrative control without cluttering the base prompt with conditional information.
The core insight is that LLMs tend to surface information present in their context. By controlling when information enters the context rather than relying on the model to withhold it, we achieve more reliable narrative control.
Large Language Models are fundamentally "helpful explainers" — they see information and want to surface it. This creates challenges when:
Instead of putting secrets in the prompt and hoping the model withholds them, we keep information OUT of context until conditions are met. The outlet system combined with regex triggers creates a gating mechanism where content only enters the prompt when narrative conditions fire.
The outlet feature in SillyTavern's World Info system provides manual injection points for dynamically assembled content.
{{outlet::YourName}} macrosOutlet macros CAN be placed in:
Outlet macros CANNOT be placed in:
{{outlet::Tools}} ≠ {{outlet::tools}}SillyTavern supports JavaScript regex syntax for World Info keys, enabling pattern-based activation rather than simple keyword matching.
/ delimiters: /pattern/flags/i flag for case-insensitivity(?:...) not (...)| Pattern | Purpose |
|---|---|
(?:word1|word2|word3) | Match any of listed alternatives |
(?:optional )? | Make segment optional |
{{char}} | Placeholder for character name |
{{user}} | Placeholder for user name |
\x01 | Message separator in scan buffer |
[^\x01]*? | Match within single message |
SillyTavern prefixes each message with character name: and separates them with \x01. This enables targeting specific speakers:
/\x01{{user}}:[^\x01]*?keyword/i↑ Match only USER saying "keyword"
/\x01{{char}}:[^\x01]*?keyword/i↑ Match only CHARACTER saying "keyword"
Create a prompt template with named "slots" that outlets feed into:
[System Prompt]
[Character Defs] (native)
{{outlet::char_augments}} ← Custom block
[Scenario] (native)
{{outlet::scene_state}} ← Custom block
[Chat History]
{{outlet::active_directives}} ← Custom blockUse inclusion groups to create mutually exclusive states where only one can be active:
Use timed effects to gate content by conversation length:
Combine with recursion: Trust Level 2 activates from Trust Level 1's content appearing.
Secrets aren't data to store — they're behavioral patterns to model, plus gated content that only enters context at the right narrative moment.
Instead of stating the secret, describe how the character ACTS around it:
BAD:
Sarah murdered her brother.GOOD:
Sarah carries a secret she has never spoken aloud. She deflects,
changes subject, or becomes defensive if conversation approaches
her brother or her past.Define what the character DOESN'T do:
{{char}} DOES NOT:
- Volunteer information about past unprompted
- Explain motivations or backstory directly
- Answer questions about [topic] honestly until [condition]
{{char}} DOES:
- Deflect with humor or redirect questions
- Give partial truths that satisfy without revealing
- Show discomfort through body language, not expositionKeep the character card minimal (behavioral scaffolding only). All actual lore lives in World Info entries with strict trigger conditions.
| Field | Value |
|---|---|
| Key | (leave empty) |
| Strategy | 🔵 Constant |
| Position | After Char Defs |
| Inclusion Group | name_state |
| Group Weight | 100 |
Content:
{{char}} has not shared her real name. She introduces herself as "V"
and deflects or ignores direct questions about her full name. She
treats it as unimportant, changes the subject, or makes a joke if pressed.| Field | Value |
|---|---|
| Key | /(?:{{char}}|she) (?:finally )?(?:tells|shares|reveals) (?:her )?(?:real )?name/i |
| Optional Filter | trust, earned, deserve, friend, saved, love |
| Filter Logic | AND ANY |
| Strategy | 🟢 Keyword |
| Position | Outlet |
| Outlet Name | name_reveal |
| Inclusion Group | name_state |
| Group Weight | 200 |
| Prioritize Inclusion | ✅ Enabled |
| Sticky | 999 |
Content:
{{char}}'s real name is Vivienne Ashford. She has chosen to share this
with {{user}}. This is significant — she does not give her name lightly.
She may say it quietly, without ceremony, or frame it as a gift.| Field | Value |
|---|---|
| Key | /(?:finds?|discovers?|sees?|reads?) (?:her )?(?:real )?(?:name|identity|ID)/i |
| Strategy | 🟢 Keyword |
| Position | Outlet |
| Outlet Name | name_reveal |
| Inclusion Group | name_state |
| Group Weight | 200 |
| Prioritize Inclusion | ✅ Enabled |
| Sticky | 999 |
Content:
{{char}}'s real name is Vivienne Ashford. {{user}} has discovered this
without it being freely given. {{char}} may react with guardedness,
embarrassment, anger, or resignation depending on context.| Field | Value |
|---|---|
| Key | Vivienne Ashford |
| Strategy | 🟢 Keyword |
| Delay until recursion | ✅ Enabled |
| Non-recursable | ✅ Enabled |
| Position | After Char Defs |
Content:
{{user}} knows {{char}}'s real name is Vivienne. She accepts being
called Vivienne by {{user}}, though she still uses "V" with others.| Field | Value |
|---|---|
| Name | Identity Reveals |
| Role | System |
| Position | In-Chat |
| Depth | 1 |
| Content | {{outlet::name_reveal}} |
The secret never exists in context until earned or discovered.
These patterns detect narrative moments by matching the atmosphere and lead-up rather than explicit statements.
/(?:you )?(?:saved|protected|trusted) (?:my )?(?:life|everything|me)/i/(?:I )?(?:owe|trust) (?:you|him|her)/i/(?:never told|haven't shared|no one knows) (?:anyone|anybody|a soul)/i/(?:met|held|caught|searched) (?:her|his|their) (?:eyes|gaze|look)/i/(?:looked|stared|gazed) (?:at|into) (?:her|his|their|{{user}})/i/(?:long |heavy |comfortable )?silence/i/(?:{{char}}|she|he) (?:was |seemed )?(?:wounded|bleeding|exhausted|crying)/i/(?:fire|embers) (?:crackled|burned|died)/i/(?:alone|quiet|still) (?:together|now|finally)/i/(?:hesitated|paused|took a breath|swallowed hard)/i/voice (?:was |went )?(?:quiet|soft|low|small)/iCombat:
/(?:attacks?|swings?|dodges?|parries?|casts?|fires?)/iLocation change:
/(?:enters?|arrives?|walks? into|steps? into) (?:the )?/iTime shift:
/(?:morning|afternoon|evening|night|dawn|dusk)/iUse these templates with any LLM to generate context-appropriate regex triggers.
Include this with all prompts:
You are creating regex trigger keys for SillyTavern World Info entries.
These triggers detect narrative moments in roleplay/fiction to dynamically
inject context.
FORMAT REQUIREMENTS:
- Use JavaScript regex syntax with / delimiters
- Always include /i flag for case-insensitivity
- Use non-capturing groups: (?:...) not (...)
- Use (?:word1|word2|word3) for alternatives
- Use (?: )? for optional segments
- Support {{char}} and {{user}} as literal placeholders
- Keep patterns under 200 characters when possible
- Avoid overly specific phrases - target common language patterns
OUTPUT FORMAT for each regex:
1. Pattern name
2. The regex
3. What it catches (3-5 example phrases)
4. False positive risks
5. Suggested Optional Filter words (AND ANY)
Focus on words/phrases that PRECEDE or ACCOMPANY the target moment,
not explicit statements of it.[Insert Base Instruction Block]
TASK: Generate regex triggers for detecting when a character enters
or displays [EMOTIONAL STATE].
Target emotion: [INSERT: anger / fear / sadness / joy / shame /
guilt / jealousy / love / despair / hope]
Consider:
- Physical manifestations (body language, voice changes, breathing)
- Behavioral shifts (what they start/stop doing)
- Environmental reflections (pathetic fallacy)
- Dialogue markers (tone shifts, word choice)
- Internal state words others might observe
Generate 3-5 regex patterns ranging from subtle to overt detection.[Insert Base Instruction Block]
TASK: Generate regex triggers for detecting [RELATIONSHIP MILESTONE]
moments between characters.
Target milestone: [INSERT: first meeting / growing trust / betrayal /
reconciliation / confession of feelings / physical
intimacy / breaking up / forming alliance / rivalry emerging]
Consider:
- Dialogue patterns typical of this moment
- Physical proximity/distance language
- Emotional vocabulary surrounding this transition
- Actions that typically accompany this beat
- Time/silence markers
Generate 3-5 regex patterns that catch the LEAD-UP and the MOMENT itself.[Insert Base Instruction Block]
TASK: Generate regex triggers for detecting when the narrative enters
a [SCENE TYPE].
Target scene type: [INSERT: combat / chase / investigation / negotiation /
heist / escape / ritual / travel / rest/camp /
celebration / funeral / trial / training / stealth]
Consider:
- Verbs specific to this activity
- Objects/tools commonly mentioned
- Environmental descriptors
- Temporal markers (pacing words)
- Character positioning language
- Tension/stakes vocabulary
Generate 4-6 regex patterns covering scene initiation, active scene,
and scene conclusion.[Insert Base Instruction Block]
TASK: Generate regex triggers for detecting when a character is in
[PHYSICAL/MENTAL STATE].
Target state: [INSERT: wounded / exhausted / intoxicated / sick /
dying / unconscious / restrained / hidden / disguised /
armed / hungry / cold / lost]
Consider:
- Direct descriptions of the condition
- Behavioral symptoms
- Limitations on action
- Other characters' reactions
- Recovery/worsening language
Generate 3-5 regex patterns for state onset, active state, and
state resolution.[Insert Base Instruction Block]
TASK: Generate regex triggers for detecting [POWER DYNAMIC] moments.
Target dynamic: [INSERT: submission / dominance / surrender / defiance /
manipulation / intimidation / protection / rescue /
capture / liberation]
Consider:
- Positional language (above/below, standing/kneeling)
- Voice/volume markers
- Eye contact and gaze patterns
- Physical control vocabulary
- Dialogue patterns of each role
- Transition moments between states
Generate 3-5 regex patterns that catch these dynamics emerging or shifting.[Insert Base Instruction Block]
TASK: Generate regex triggers for detecting [INFORMATION TYPE] being shared.
Target information type: [INSERT: secret / lie / confession / warning /
threat / promise / plan / backstory / revelation /
deception discovered]
Consider:
- Pre-confession hesitation language
- Trust/distrust vocabulary
- Delivery markers (whispered, admitted, blurted)
- Recipient reaction patterns
- Secrecy/privacy indicators
- Consequence acknowledgment
Generate 3-5 regex patterns for the buildup, the exchange, and the aftermath.[Insert Base Instruction Block]
TASK: Generate regex triggers for detecting [ATMOSPHERE/SETTING]
in the narrative.
Target atmosphere: [INSERT: danger approaching / safety/sanctuary /
romantic tension / horror/dread / mystery / wonder/awe /
melancholy / chaos / calm before storm]
Consider:
- Sensory descriptors (sound, light, temperature, smell)
- Weather and time-of-day markers
- Space descriptors (enclosed, open, high, deep)
- Character perception language
- Pacing indicators (slow, sudden, gradual)
- Symbolic/metaphoric patterns
Generate 4-6 regex patterns for atmosphere establishment and intensification.[Insert Base Instruction Block]
TASK: Generate regex triggers for detecting common beats in [GENRE] fiction.
Target genre: [INSERT: noir / fantasy / sci-fi / horror / romance /
thriller / western / military / slice-of-life / mystery]
Identify 5 signature scene types or moments specific to this genre,
then generate 1-2 regex patterns for each.
Consider:
- Genre-specific vocabulary and jargon
- Trope indicators
- Setting markers unique to genre
- Character archetype language
- Plot beat patterns
- Tonal markers[Insert Base Instruction Block]
TASK: Generate regex triggers for detecting [DIALOGUE PATTERN] in conversation.
Target pattern: [INSERT: interrogation / flirtation / argument /
negotiation / comfort / command / plea / sarcasm /
evasion / storytelling]
Consider:
- Question structures
- Response patterns
- Turn-taking markers
- Emotional subtext indicators
- Power balance in exchange
- Non-verbal interjections (sighs, pauses, laughter)
Generate 3-5 regex patterns that catch this conversational mode activating.
IMPORTANT: These should catch the PATTERN, not specific content.
Focus on structural markers.[Insert Base Instruction Block]
TASK: I will describe a specific narrative moment. Analyze it and
generate regex triggers.
MY SCENE DESCRIPTION:
[INSERT: 2-3 sentence description of the moment you want to detect]
Please:
1. Identify the core narrative function of this moment
2. List 10-15 words/phrases commonly used BEFORE this moment
3. List 10-15 words/phrases commonly used DURING this moment
4. Generate 3-5 regex patterns from most subtle to most explicit
5. Suggest Optional Filter words for precision
6. Identify what FALSE POSITIVES might occur and how to mitigate/i flag (case sensitivity breaks matches)(...) instead of non-capturing (?:...)| Field | Purpose |
|---|---|
| Key | Trigger keywords or regex patterns |
| Optional Filter | Additional required/excluded keywords |
| Strategy | 🔵 Constant / 🟢 Keyword / 🔗 Vector |
| Position | Where content inserts (or Outlet for manual) |
| Outlet Name | Label for manual {{outlet::X}} retrieval |
| Inclusion Group | Mutual exclusion grouping |
| Group Weight | Selection probability within group |
| Prioritize Inclusion | Use Order instead of Weight for selection |
| Sticky | Messages to stay active after trigger |
| Cooldown | Messages before can re-trigger |
| Delay | Minimum messages before can trigger |
| Pattern | Meaning |
|---|---|
(?:a|b|c) | Match a OR b OR c |
(?:word )? | Optional "word " |
\s | Any whitespace |
\w+ | One or more word characters |
.*? | Any characters (non-greedy) |
[^\x01]*? | Within single message |
/i | Case-insensitive flag |
{{char}} | Character name placeholder |
{{user}} | User name placeholder |
{{outlet::OutletName}}Place in: Custom Prompt Manager blocks, Advanced Formatting fields
Cannot place in: Character cards, Author's Note, inside WI entries
| Effect | Value | Behavior |
|---|---|---|
| Sticky | N | Entry stays active for N messages after triggering |
| Cooldown | N | Entry cannot re-trigger for N messages after expiring |
| Delay | N | Entry cannot trigger unless N messages exist in chat |
This paragraph should trigger the name revelation system:
She sat with her back against the cold stone, bandaging the gash on her arm. He'd carried her three miles through the woods after the ambush. Neither of them had spoken since.
The fire crackled between them. Outside, rain. Inside, just breathing.
"You didn't have to come back for me," she said.
"Yes I did."
She looked up. Met his eyes. Held them longer than she meant to.
"No one's ever—" She stopped. Swallowed hard. The words felt strange in her mouth, rusted from disuse.
"Vivienne," she said, voice quiet. "My name. It's Vivienne."
Triggers activated:
met his eyes ✓fire crackled ✓voice quiet ✓swallowed hard ✓alone, wounded, trust (implied) ✓The regex catches the atmosphere of revelation, not just explicit "tells her name" language.
Guide compiled from SillyTavern documentation and practical experimentation with dynamic World Info systems.