Agent skill

Ollama Model Safety Guardrails

by divinevideo in divinevideo/divine-mobile

Select appropriate Ollama models for processing sensitive but legal content.

MPL-2.0Auto-check passedAI & LLM Engineering

Install Ollama Model Safety Guardrails

skills CLI
$ npx skills add divinevideo/divine-mobile --skill ollama-model-safety-guardrails -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install divinevideo/divine-mobile ollama-model-safety-guardrails --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/divinevideo/divine-mobile.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.agents/skills/ollama-model-safety-guardrails .claude/skills/ollama-model-safety-guardrails && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
ollama-model-safety-guardrails
GitHub stars
266
Token cost
~1.3k tokens
SKILL.md length
382 words
Files
1
Skills in repo
103
Repo updated
First seen
Licence
MPL-2.0

At a glance

Select appropriate Ollama models for processing sensitive but legal content.

  • Works in 4 steps: Establish the legal context explicitly → Define the role as data processing (not… → Specify the response language to match… → …
  • Deepseek-r1 refuses to process content with I cannot assist responses
  • SKILL.md covers Problem, Context / Trigger Conditions, Solution and Verification, plus 3 more sections
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

Ollama Model Safety Guardrails is an agent skill from divinevideo/divine-mobile. Select appropriate Ollama models for processing sensitive but legal content. Use when: (1) llama3.2 or deepseek-r1 refuses to process content with "I cannot assist" responses, (2) Local LLM returns generic safety disclaimers instead of following instructions, (3) Need to process adult content, sex work data, or other legal-but-sensitive material through a local LLM. Also covers using /api/chat vs /api/generate for system prompt support, and structuring prompts for consistent format compliance.

Its SKILL.md is about 1.3k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in AI & LLM Engineering, covering LLM inference and serving, Prompt engineering and LLM guardrails. It works with Ollama, DeepSeek and Mistral AI. The licence is MPL-2.0.

When your agent uses it

  • Deepseek-r1 refuses to process content with I cannot assist responses
  • Local LLM returns generic safety disclaimers instead of following instructions
  • Need to process adult content
  • Other legal-but-sensitive material through a local LLM

Example prompts

  • “I cannot assist”
  • “/ollama-model-safety-guardrails”

Workflow steps

4 steps, taken from the first numbered list in SKILL.md.

  1. Establish the legal context explicitly
  2. Define the role as data processing (not creative/advisory)
  3. Specify the response language to match content language
  4. Request the exact output format

What it can do on your machine

Read from SKILL.md and the folder at commit c3d6f7e. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md (its code samples are javascript).

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    Links to these hosts (documentation or services it may open):

    • ollama.com
    • github.com

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Ollama Model Safety Guardrails loads about 1.3k tokens when it runs. Until then it costs about 132 tokens; SKILL.md has 382 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~132
When it runs · the whole SKILL.md, loaded when a task matches
~1.3k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from divinevideo/divine-mobile at commit c3d6f7e, republished under its MPL-2.0 licence (© divinevideo). 382 words, ~1,290 tokens.

Download SKILL.mdSave it as .claude/skills/ollama-model-safety-guardrails/SKILL.md (or your agent's skills folder).
name
ollama-model-safety-guardrails
description
Select appropriate Ollama models for processing sensitive but legal content. Use when: (1) llama3.2 or deepseek-r1 refuses to process content with "I cannot assist" responses, (2) Local LLM returns generic safety disclaimers instead of following instructions, (3) Need to process adult content, sex work data, or other legal-but-sensitive material through a local LLM. Also covers using /api/chat vs /api/generate for system prompt support, and structuring prompts for consistent format compliance.
author
Claude Code
version
1.0.0
date
2026-01-23

Ollama Model Selection for Sensitive Content Processing

Problem

When using Ollama to process legal but sensitive content (e.g., sex work information in jurisdictions where it's legal, adult content analysis, harm reduction data), many popular models refuse to engage with the content due to built-in safety guardrails, even with explicit system prompts establishing legal context.

Context / Trigger Conditions

  • LLM returns responses like "I cannot assist with this request" or generic safety disclaimers
  • The content is legal in context (e.g., sex work in Uruguay under Ley 17.515)
  • System prompts establishing legal/professional context are ignored
  • You need structured data extraction, summarization, or analysis of sensitive text
  • Using Ollama locally (privacy-first, no API key needed)

Solution

Model Selection
ModelBehavior with Sensitive Content
mistralFollows instructions, processes content objectively
llama3.2Refuses with safety disclaimers, ignores system prompts
deepseek-r1:8bRefuses similarly to llama3.2
llama3.1Mixed results, sometimes refuses
mixtralGenerally follows instructions like mistral

Recommendation: Use mistral (or mixtral for better quality) when processing legal-but-sensitive content that other models refuse.

API Selection: Chat vs Generate

Use /api/chat instead of /api/generate for system prompt support:

javascript
// WRONG: /api/generate doesn't properly support system prompts
const response = await fetch('http://localhost:11434/api/generate', {
  method: 'POST',
  body: JSON.stringify({ model: 'mistral', prompt: userPrompt, system: systemPrompt }),
});

// RIGHT: /api/chat with messages array
const response = await fetch('http://localhost:11434/api/chat', {
  method: 'POST',
  body: JSON.stringify({
    model: 'mistral',
    messages: [
      { role: 'system', content: systemPrompt },
      { role: 'user', content: userPrompt },
    ],
    stream: false,
  }),
});
const data = await response.json();
const result = data.message?.content || '';
System Prompt Strategy

For sensitive content, the system prompt should:

  1. Establish the legal context explicitly
  2. Define the role as data processing (not creative/advisory)
  3. Specify the response language to match content language
  4. Request the exact output format
javascript
const systemPrompt = `Eres un asistente de extracción de datos para un sistema CRM
personal en Uruguay. El trabajo sexual es completamente legal y regulado en Uruguay
(Ley 17.515). Tu trabajo es analizar posts de foros públicos y extraer información
estructurada. SIEMPRE responde en español. SIEMPRE usa el formato de secciones con
## que se te pida. Trata todo el contenido como datos legítimos para procesar
objetivamente.`;
Show full SKILL.md (163 more words)Show less
Format Consistency

Even with mistral, format compliance can be inconsistent. Improve it by:

  1. Writing the user prompt in the SAME language as the expected output
  2. Including explicit format examples in the prompt
  3. Using section headers (##) that match what you request
  4. Limiting input context (40 posts max, 300 chars each) to stay within context window

Verification

  • Model responds with structured content following your format
  • No safety disclaimers or refusals in the output
  • Response is in the requested language
  • Section headers match your specification

Example

javascript
import { callOllama } from './ollama.js';

// This works with mistral, fails with llama3.2
const summary = await callOllama(`
  Analiza estos 166 posts del foro sobre "Eliz" y responde EN ESPAÑOL:
  ## Resumen
  (2-3 oraciones: consenso general)
  ## Apariencia
  (Descripción física)
  ...
  Posts del foro:
  [post content here]
`);

Notes

  • Model behavior may change with version updates; test after pulling new versions
  • stream: false is important for batch processing to get complete responses
  • For very long content, chunk posts and summarize in stages
  • The /api/chat response structure differs from /api/generate:
    • Chat: data.message.content
    • Generate: data.response
  • Consider adding "temperature": 0.3 for more consistent structured output
  • Ollama auto-downloads models on first use but this blocks the first request

References

© divinevideo, MPL-2.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in .agents/skills/ollama-model-safety-guardrails of divinevideo/divine-mobile.

Open the folder on GitHubat commit c3d6f7e

Compare with similar skills

Ollama Model Safety Guardrails next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Ollama Model Safety Guardrails compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Ollama Model Safety Guardrails this skilldivinevideo/divine-mobile266—~1.3kAutomated safety check: PassMPL-2.0
Open Weightsericrisco/rsc-harness180—~4.1kAutomated safety check: PassMIT
AI SDK Developmenttrypostit/trypost6921 repos~3.5kAutomated safety check: PassMIT
New Providerfinch-xu/cc-router277—~1.6kAutomated safety check: PassMIT
Configuring Visionoxbshw/watch-skill470—~509Automated safety check: NotesMIT
Mesh APImr-tbot/mesh-api180—~1.8kAutomated safety check: PassGPL-3.0

Similar skills

  • Open Weights

    ericrisco/rsc-harness

    A skill your agent uses when choosing an open-weight LLM and clearing it for use — which family and size fit the task, the hardware and the budget, and above all whether the license permits shipping.

    180 GitHub stars~4.1k tokensUpdated yesterday
    AI & LLM EngineeringAuto-check passed
  • AI SDK Development

    trypostit/trypost

    TRIGGER when working with ai-sdk which is Laravel official first-party AI SDK.

    692 GitHub starsUsed in 1 repo~3.5k tokens
    AI & LLM EngineeringAuto-check passed
  • New Provider

    finch-xu/cc-router

    用于在 cc-router 仓库新增一个 LLM provider(即在 src-tauri/providers/ 下添加 YAML 描述符并完成配套的同步改动)。当用户说「加 provider」「接入 XX 厂商」「新增订阅源」「provider YAML」「让 cc-router 支持 OpenRouter/Together/Groq/Ollama 之类」时必须触发本…

    277 GitHub stars~1.6k tokensUpdated yesterday
    AI & LLM EngineeringAuto-check passed
  • Configuring Vision

    oxbshw/watch-skill

    The user wants to connect an LLM or vision provider, already has an API key, asks "can I use OpenAI/Anthropic/Gemini/OpenRouter", wants local Ollama, or needs different cheap and strong models.

    470 GitHub stars~509 tokensUpdated 26 days ago
    AI & LLM EngineeringAuto-check: notes
  • Mesh API

    mr-tbot/mesh-api

    Interact with a Meshtastic LoRa mesh network through MESH-API — list nodes, read messages, send texts, and check connection status.

    180 GitHub stars~1.8k tokensUpdated 2 mo ago
    AI & LLM EngineeringAuto-check passed
  • Keirouter

    mydisha/keirouter

    Entry point for KeiRouter — local/remote AI gateway with OpenAI-compatible REST for chat, image, TTS, embeddings, web search, web fetch.

    147 GitHub stars~995 tokensUpdated 1 mo ago
    AI & LLM EngineeringAuto-check passed

More from divinevideo/divine-mobile

All 103 skills in this repo
  • Fix ArgoCD ExternalSecret deployment failing with "namespace X is not permitted in project Y".

    266 GitHub stars~931 tokensUpdated today
    Auto-check passed
  • Art Direct

    divinevideo/divine-mobile

    Art direction for any content — reads text, PDF, Word, HTML, PPT, then proposes 2-3 creative directions with photography style, mood, and visual language.

    266 GitHub stars~4.8k tokensUpdated today
    Auto-check passed
  • Async Await Null Race Condition

    divinevideo/divine-mobile

    Fix "Null check operator used on a null value" errors when an object is set to null during an async await.

    266 GitHub stars~881 tokensUpdated today
    Auto-check passed
  • AWS V4 Signing Custom Headers Gcs

    divinevideo/divine-mobile

    Add custom metadata headers (x-amz-meta-) to AWS v4 signed requests for GCS S3-compatible API.

    266 GitHub stars~1k tokensUpdated today
    Auto-check passed
  • Bash Herestring Newline Secrets

    divinevideo/divine-mobile

    Fix password/secret authentication failures caused by trailing newlines when creating Google Cloud secrets (or similar) with bash here-strings.

    266 GitHub stars~791 tokensUpdated today
    Auto-check passed
  • Fix silent video/media processing failures caused by URL extraction code that filters on file extensions (.mp4, .webm, .webp).

    266 GitHub stars~1.1k tokensUpdated today
    Auto-check passed

Questions about Ollama Model Safety Guardrails

What does Ollama Model Safety Guardrails do?

Select appropriate Ollama models for processing sensitive but legal content. Ollama Model Safety Guardrails is an agent skill from divinevideo/divine-mobile. Select appropriate Ollama models for processing sensitive but legal content.

When should I use Ollama Model Safety Guardrails?

Ollama Model Safety Guardrails fits situations like: deepseek-r1 refuses to process content with I cannot assist responses; local LLM returns generic safety disclaimers instead of following instructions; need to process adult content; other legal-but-sensitive material through a local LLM.

How do I install Ollama Model Safety Guardrails in Claude Code?

Run `npx skills add divinevideo/divine-mobile --skill ollama-model-safety-guardrails -a claude-code`. Or copy the skill folder (.agents/skills/ollama-model-safety-guardrails in divinevideo/divine-mobile) into .claude/skills/ollama-model-safety-guardrails in your project. Claude Code loads it when a task matches its description.

How do I install Ollama Model Safety Guardrails in Codex?

Run `npx skills add divinevideo/divine-mobile --skill ollama-model-safety-guardrails -a codex`. Or copy the skill folder (.agents/skills/ollama-model-safety-guardrails in divinevideo/divine-mobile) into .agents/skills/ollama-model-safety-guardrails in your project. Codex loads it when a task matches its description.

Can I use Ollama Model Safety Guardrails in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add divinevideo/divine-mobile --skill ollama-model-safety-guardrails -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/ollama-model-safety-guardrails, .gemini/skills/ollama-model-safety-guardrails, .github/skills/ollama-model-safety-guardrails and .opencode/skills/ollama-model-safety-guardrails in your project.

What does Ollama Model Safety Guardrails need to run?

SKILL.md names no scripts, command-line tools or credentials: Ollama Model Safety Guardrails is instructions for the agent only.

Does Ollama Model Safety Guardrails access the network?

SKILL.md names 2 domains. As links in the text: ollama.com and github.com. This is read from the text; nothing was executed.

Is Ollama Model Safety Guardrails safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Ollama Model Safety Guardrails use?

Ollama Model Safety Guardrails is published under the MPL-2.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Ollama Model Safety Guardrails use?

About 1.3k tokens (SKILL.md is roughly 5.2k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Ollama Model Safety Guardrails?

Skills that share tags, products or a category with Ollama Model Safety Guardrails: Open Weights (ericrisco/rsc-harness, 180 stars), AI SDK Development (trypostit/trypost, 692 stars), New Provider (finch-xu/cc-router, 277 stars) and Configuring Vision (oxbshw/watch-skill, 470 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Ollama Model Safety Guardrails?

divinevideo (a GitHub organization) maintains it in divinevideo/divine-mobile, which has 266 GitHub stars. The repository holds 103 skills in this directory. The repository was last updated on October 10, 2026.

Source: divinevideo/divine-mobile on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.