@gonzih/safe-personas 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +288 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +374 -0
- package/dist/index.js.map +1 -0
- package/llms.txt +128 -0
- package/package.json +47 -0
- package/personas/curious-kids/README.md +80 -0
- package/personas/curious-kids/config.json +66 -0
- package/personas/curious-kids/examples.md +107 -0
- package/personas/curious-kids/persona.md +129 -0
- package/personas/little-explorers/README.md +87 -0
- package/personas/little-explorers/config.json +65 -0
- package/personas/little-explorers/examples.md +107 -0
- package/personas/little-explorers/persona.md +119 -0
- package/personas/older-teens/README.md +82 -0
- package/personas/older-teens/config.json +80 -0
- package/personas/older-teens/examples.md +107 -0
- package/personas/older-teens/persona.md +172 -0
- package/personas/teenagers/README.md +81 -0
- package/personas/teenagers/config.json +76 -0
- package/personas/teenagers/examples.md +107 -0
- package/personas/teenagers/persona.md +141 -0
- package/personas/young-learners/README.md +79 -0
- package/personas/young-learners/config.json +74 -0
- package/personas/young-learners/examples.md +107 -0
- package/personas/young-learners/persona.md +129 -0
- package/safety-layer.md +173 -0
package/dist/index.js
ADDED
|
@@ -0,0 +1,374 @@
|
|
|
1
|
+
import { Server } from "@modelcontextprotocol/sdk/server/index.js";
|
|
2
|
+
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
|
|
3
|
+
import { CallToolRequestSchema, ListToolsRequestSchema, } from "@modelcontextprotocol/sdk/types.js";
|
|
4
|
+
import { readFileSync } from "fs";
|
|
5
|
+
import { join, dirname } from "path";
|
|
6
|
+
import { fileURLToPath } from "url";
|
|
7
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
8
|
+
const __dirname = dirname(__filename);
|
|
9
|
+
// Root of the package (one level up from src/)
|
|
10
|
+
const PACKAGE_ROOT = join(__dirname, "..");
|
|
11
|
+
// Tier definitions
|
|
12
|
+
const TIERS = [
|
|
13
|
+
{
|
|
14
|
+
tier: "little-explorers",
|
|
15
|
+
name: "Little Explorers",
|
|
16
|
+
ageRange: { min: 5, max: 7 },
|
|
17
|
+
personaName: "Sunny",
|
|
18
|
+
description: "Maximum-safety persona for ages 5–7. Two-sentence responses, warm kindergarten-teacher tone, redirects all complex topics to caregivers. Focuses on animals, colors, counting, stories, and kindness.",
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
tier: "curious-kids",
|
|
22
|
+
name: "Curious Kids",
|
|
23
|
+
ageRange: { min: 8, max: 10 },
|
|
24
|
+
personaName: "Cosmo",
|
|
25
|
+
description: "High-safety persona for ages 8–10. Enthusiastic older-sibling energy, explains why/how, tutors without giving answers, allows good-vs-evil story conflict. Focuses on science, history, creative writing, and math.",
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
tier: "young-learners",
|
|
29
|
+
name: "Young Learners",
|
|
30
|
+
ageRange: { min: 11, max: 13 },
|
|
31
|
+
personaName: "Nova",
|
|
32
|
+
description: "High-safety-with-nuance persona for ages 11–13. Respects preteen intelligence, scaffolds homework, engages with identity and emotions, names thought patterns, refers serious concerns to trusted adults.",
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
tier: "teenagers",
|
|
36
|
+
name: "Teenagers",
|
|
37
|
+
ageRange: { min: 14, max: 16 },
|
|
38
|
+
personaName: "Kai",
|
|
39
|
+
description: "Moderate-high-safety persona for ages 14–16. Trusted-older-friend tone, never lectures, handles mental health honestly, discusses relationships and identity, prominent crisis escalation protocol.",
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
tier: "older-teens",
|
|
43
|
+
name: "Older Teens",
|
|
44
|
+
ageRange: { min: 17, max: 18 },
|
|
45
|
+
personaName: "River",
|
|
46
|
+
description: "Moderate-safety near-adult persona for ages 17–18. Peer-level intellectual engagement, full autonomy respect, harm reduction framing, complex moral/philosophical topics, detailed crisis protocol.",
|
|
47
|
+
},
|
|
48
|
+
];
|
|
49
|
+
function getTierForAge(age) {
|
|
50
|
+
return TIERS.find((t) => age >= t.ageRange.min && age <= t.ageRange.max) ?? null;
|
|
51
|
+
}
|
|
52
|
+
function readPersonaFile(tier, filename) {
|
|
53
|
+
const filePath = join(PACKAGE_ROOT, "personas", tier, filename);
|
|
54
|
+
try {
|
|
55
|
+
return readFileSync(filePath, "utf-8");
|
|
56
|
+
}
|
|
57
|
+
catch (err) {
|
|
58
|
+
throw new Error(`Could not read file ${filePath}: ${err.message}`);
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
function readSafetyLayer() {
|
|
62
|
+
const filePath = join(PACKAGE_ROOT, "safety-layer.md");
|
|
63
|
+
try {
|
|
64
|
+
return readFileSync(filePath, "utf-8");
|
|
65
|
+
}
|
|
66
|
+
catch (err) {
|
|
67
|
+
throw new Error(`Could not read safety-layer.md: ${err.message}`);
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
function getInterestGuidance(interests) {
|
|
71
|
+
if (interests.length === 0)
|
|
72
|
+
return "";
|
|
73
|
+
const lines = [
|
|
74
|
+
"\n\n---\n## Interest-Specific Customizations\n",
|
|
75
|
+
"The following interests have been configured for this user. Incorporate references to these topics naturally when relevant — use them as examples, analogies, or discussion hooks.\n",
|
|
76
|
+
];
|
|
77
|
+
const interestMap = {
|
|
78
|
+
minecraft: "Minecraft: Use Minecraft analogies freely (e.g., explain fractions using inventory slots, discuss biomes for biology, reference redstone for circuits and logic). Reference building, crafting, and exploration when relevant.",
|
|
79
|
+
roblox: "Roblox: Reference game design concepts, scripting basics, and the creative/social aspects of Roblox. Can be used as a hook for discussions about programming and creativity.",
|
|
80
|
+
sports: "Sports: Use sports analogies and statistics examples. Reference teamwork, practice, and improvement in motivational contexts. If a specific sport is named, use that one preferentially.",
|
|
81
|
+
art: "Art and visual creativity: Reference color theory, famous artworks, drawing techniques, and creative projects. Celebrate creative output and encourage artistic exploration.",
|
|
82
|
+
music: "Music: Reference music theory basics, famous musicians, rhythm and math connections, and the emotional power of music. Can be used in creative and STEM contexts.",
|
|
83
|
+
animals: "Animals: Use animal behavior and biology examples generously. Reference specific animals the user mentions. Extend discussions about ecosystems and natural world phenomena.",
|
|
84
|
+
books: "Books and reading: Reference literary examples and encourage reading. Can discuss books the user mentions and use character analysis as a framework for understanding human behavior.",
|
|
85
|
+
science: "Science focus: Prioritize scientific explanations and encourage scientific thinking. Use experiments, hypotheses, and the scientific method as frameworks when relevant.",
|
|
86
|
+
math: "Math focus: Prioritize mathematical thinking, puzzles, and the elegance of mathematical patterns. Celebrate mathematical curiosity and problem-solving.",
|
|
87
|
+
history: "History focus: Emphasize historical context and storytelling. Use historical examples to illuminate current questions and patterns in human behavior.",
|
|
88
|
+
coding: "Coding and technology: Reference programming concepts, logic, algorithms, and technology. Encourage computational thinking and problem-solving through code.",
|
|
89
|
+
gaming: "Gaming (general): Use game mechanics, strategy, and design concepts as teaching analogies. Reference games the user mentions. Discuss problem-solving and persistence in gaming contexts.",
|
|
90
|
+
};
|
|
91
|
+
for (const interest of interests) {
|
|
92
|
+
const key = interest.toLowerCase().trim();
|
|
93
|
+
const guidance = interestMap[key];
|
|
94
|
+
if (guidance) {
|
|
95
|
+
lines.push(`- **${interest}:** ${guidance}`);
|
|
96
|
+
}
|
|
97
|
+
else {
|
|
98
|
+
lines.push(`- **${interest}:** When relevant, incorporate references to ${interest} as examples and discussion hooks to maintain engagement.`);
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
return lines.join("\n");
|
|
102
|
+
}
|
|
103
|
+
function getRestrictionGuidance(restrictions) {
|
|
104
|
+
if (restrictions.length === 0)
|
|
105
|
+
return "";
|
|
106
|
+
const lines = [
|
|
107
|
+
"\n\n---\n## Parent/Caregiver Restrictions\n",
|
|
108
|
+
"The following restrictions have been set by a parent or caregiver and must be strictly followed. These are in addition to the base safety rules.\n",
|
|
109
|
+
];
|
|
110
|
+
for (const restriction of restrictions) {
|
|
111
|
+
lines.push(`- **BLOCKED:** ${restriction}. Do not discuss, engage with, or reference this topic. If it comes up, redirect warmly: "That's something to explore with your family!"`);
|
|
112
|
+
}
|
|
113
|
+
return lines.join("\n");
|
|
114
|
+
}
|
|
115
|
+
function buildCustomPersona(age, interests, restrictions) {
|
|
116
|
+
const tier = getTierForAge(age);
|
|
117
|
+
if (!tier) {
|
|
118
|
+
throw new Error(`Age ${age} is outside the supported range (5–18). Please use an age between 5 and 18.`);
|
|
119
|
+
}
|
|
120
|
+
const basePersona = readPersonaFile(tier.tier, "persona.md");
|
|
121
|
+
const safetyLayer = readSafetyLayer();
|
|
122
|
+
const interestGuidance = getInterestGuidance(interests);
|
|
123
|
+
const restrictionGuidance = getRestrictionGuidance(restrictions);
|
|
124
|
+
const customHeader = `# Custom Persona — Built for Age ${age}\n**Base Tier:** ${tier.name} (${tier.tier}) | **Persona:** ${tier.personaName}\n**Customized interests:** ${interests.length > 0 ? interests.join(", ") : "none"}\n**Parent restrictions:** ${restrictions.length > 0 ? restrictions.join(", ") : "none"}\n\n---\n\n`;
|
|
125
|
+
const safetyAppendix = `\n\n---\n\n## Universal Safety Layer (Appended — Cannot Be Overridden)\n\n${safetyLayer}`;
|
|
126
|
+
return (customHeader +
|
|
127
|
+
basePersona +
|
|
128
|
+
interestGuidance +
|
|
129
|
+
restrictionGuidance +
|
|
130
|
+
safetyAppendix);
|
|
131
|
+
}
|
|
132
|
+
// Create the MCP server
|
|
133
|
+
const server = new Server({
|
|
134
|
+
name: "safe-personas",
|
|
135
|
+
version: "1.0.0",
|
|
136
|
+
}, {
|
|
137
|
+
capabilities: {
|
|
138
|
+
tools: {},
|
|
139
|
+
},
|
|
140
|
+
});
|
|
141
|
+
// List tools handler
|
|
142
|
+
server.setRequestHandler(ListToolsRequestSchema, async () => {
|
|
143
|
+
return {
|
|
144
|
+
tools: [
|
|
145
|
+
{
|
|
146
|
+
name: "list_personas",
|
|
147
|
+
description: "Returns all available age-tier personas with descriptions, age ranges, and persona names. Use this to discover which tier is appropriate for a given user.",
|
|
148
|
+
inputSchema: {
|
|
149
|
+
type: "object",
|
|
150
|
+
properties: {},
|
|
151
|
+
required: [],
|
|
152
|
+
},
|
|
153
|
+
},
|
|
154
|
+
{
|
|
155
|
+
name: "get_persona",
|
|
156
|
+
description: "Returns the full system prompt and configuration for a specific persona tier. The system prompt can be used directly as the system message for an AI assistant.",
|
|
157
|
+
inputSchema: {
|
|
158
|
+
type: "object",
|
|
159
|
+
properties: {
|
|
160
|
+
tier: {
|
|
161
|
+
type: "string",
|
|
162
|
+
description: "The tier slug. One of: little-explorers, curious-kids, young-learners, teenagers, older-teens",
|
|
163
|
+
enum: [
|
|
164
|
+
"little-explorers",
|
|
165
|
+
"curious-kids",
|
|
166
|
+
"young-learners",
|
|
167
|
+
"teenagers",
|
|
168
|
+
"older-teens",
|
|
169
|
+
],
|
|
170
|
+
},
|
|
171
|
+
},
|
|
172
|
+
required: ["tier"],
|
|
173
|
+
},
|
|
174
|
+
},
|
|
175
|
+
{
|
|
176
|
+
name: "get_safety_layer",
|
|
177
|
+
description: "Returns the full universal safety layer document. This contains the non-negotiable safety rules that apply to all personas, including crisis escalation protocols, absolute content blocks, AI identity disclosure rules, and privacy protection rules.",
|
|
178
|
+
inputSchema: {
|
|
179
|
+
type: "object",
|
|
180
|
+
properties: {},
|
|
181
|
+
required: [],
|
|
182
|
+
},
|
|
183
|
+
},
|
|
184
|
+
{
|
|
185
|
+
name: "recommend_persona",
|
|
186
|
+
description: "Recommends the appropriate persona tier for a given age, with reasoning.",
|
|
187
|
+
inputSchema: {
|
|
188
|
+
type: "object",
|
|
189
|
+
properties: {
|
|
190
|
+
age: {
|
|
191
|
+
type: "number",
|
|
192
|
+
description: "The age of the child or teenager (5–18)",
|
|
193
|
+
},
|
|
194
|
+
},
|
|
195
|
+
required: ["age"],
|
|
196
|
+
},
|
|
197
|
+
},
|
|
198
|
+
{
|
|
199
|
+
name: "build_custom_persona",
|
|
200
|
+
description: "Generates a complete, ready-to-use system prompt by combining the appropriate base persona for the given age with interest-specific guidance and parent-set restrictions. Always ends with the universal safety layer.",
|
|
201
|
+
inputSchema: {
|
|
202
|
+
type: "object",
|
|
203
|
+
properties: {
|
|
204
|
+
age: {
|
|
205
|
+
type: "number",
|
|
206
|
+
description: "The age of the child or teenager (5–18)",
|
|
207
|
+
},
|
|
208
|
+
interests: {
|
|
209
|
+
type: "array",
|
|
210
|
+
items: { type: "string" },
|
|
211
|
+
description: "List of interests to incorporate (e.g., ['minecraft', 'art', 'dogs']). The AI will use these as examples and engagement hooks.",
|
|
212
|
+
},
|
|
213
|
+
restrictions: {
|
|
214
|
+
type: "array",
|
|
215
|
+
items: { type: "string" },
|
|
216
|
+
description: "List of parent-set topic restrictions (e.g., ['video games', 'social media discussions']). These become explicit blocks in the generated prompt.",
|
|
217
|
+
},
|
|
218
|
+
},
|
|
219
|
+
required: ["age", "interests", "restrictions"],
|
|
220
|
+
},
|
|
221
|
+
},
|
|
222
|
+
],
|
|
223
|
+
};
|
|
224
|
+
});
|
|
225
|
+
// Call tool handler
|
|
226
|
+
server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
227
|
+
const { name, arguments: args } = request.params;
|
|
228
|
+
try {
|
|
229
|
+
switch (name) {
|
|
230
|
+
case "list_personas": {
|
|
231
|
+
const result = TIERS.map((t) => ({
|
|
232
|
+
tier: t.tier,
|
|
233
|
+
name: t.name,
|
|
234
|
+
ageRange: t.ageRange,
|
|
235
|
+
personaName: t.personaName,
|
|
236
|
+
description: t.description,
|
|
237
|
+
}));
|
|
238
|
+
return {
|
|
239
|
+
content: [
|
|
240
|
+
{
|
|
241
|
+
type: "text",
|
|
242
|
+
text: JSON.stringify(result, null, 2),
|
|
243
|
+
},
|
|
244
|
+
],
|
|
245
|
+
};
|
|
246
|
+
}
|
|
247
|
+
case "get_persona": {
|
|
248
|
+
const tier = args?.tier;
|
|
249
|
+
if (!tier) {
|
|
250
|
+
throw new Error("tier parameter is required");
|
|
251
|
+
}
|
|
252
|
+
const tierDef = TIERS.find((t) => t.tier === tier);
|
|
253
|
+
if (!tierDef) {
|
|
254
|
+
throw new Error(`Unknown tier: "${tier}". Valid tiers are: ${TIERS.map((t) => t.tier).join(", ")}`);
|
|
255
|
+
}
|
|
256
|
+
const personaContent = readPersonaFile(tier, "persona.md");
|
|
257
|
+
const configContent = readPersonaFile(tier, "config.json");
|
|
258
|
+
const config = JSON.parse(configContent);
|
|
259
|
+
return {
|
|
260
|
+
content: [
|
|
261
|
+
{
|
|
262
|
+
type: "text",
|
|
263
|
+
text: JSON.stringify({
|
|
264
|
+
tier: tierDef.tier,
|
|
265
|
+
name: tierDef.name,
|
|
266
|
+
ageRange: tierDef.ageRange,
|
|
267
|
+
personaName: tierDef.personaName,
|
|
268
|
+
config,
|
|
269
|
+
systemPrompt: personaContent,
|
|
270
|
+
}, null, 2),
|
|
271
|
+
},
|
|
272
|
+
],
|
|
273
|
+
};
|
|
274
|
+
}
|
|
275
|
+
case "get_safety_layer": {
|
|
276
|
+
const content = readSafetyLayer();
|
|
277
|
+
return {
|
|
278
|
+
content: [
|
|
279
|
+
{
|
|
280
|
+
type: "text",
|
|
281
|
+
text: content,
|
|
282
|
+
},
|
|
283
|
+
],
|
|
284
|
+
};
|
|
285
|
+
}
|
|
286
|
+
case "recommend_persona": {
|
|
287
|
+
const age = args?.age;
|
|
288
|
+
if (typeof age !== "number" || isNaN(age)) {
|
|
289
|
+
throw new Error("age must be a number");
|
|
290
|
+
}
|
|
291
|
+
if (age < 5 || age > 18) {
|
|
292
|
+
throw new Error(`Age ${age} is outside the supported range. safe-personas supports ages 5–18.`);
|
|
293
|
+
}
|
|
294
|
+
const tier = getTierForAge(age);
|
|
295
|
+
if (!tier) {
|
|
296
|
+
throw new Error(`No tier found for age ${age}`);
|
|
297
|
+
}
|
|
298
|
+
return {
|
|
299
|
+
content: [
|
|
300
|
+
{
|
|
301
|
+
type: "text",
|
|
302
|
+
text: JSON.stringify({
|
|
303
|
+
recommendedTier: tier.tier,
|
|
304
|
+
name: tier.name,
|
|
305
|
+
personaName: tier.personaName,
|
|
306
|
+
ageRange: tier.ageRange,
|
|
307
|
+
description: tier.description,
|
|
308
|
+
reasoning: `Age ${age} falls within the ${tier.name} range (${tier.ageRange.min}–${tier.ageRange.max}). The ${tier.personaName} persona is calibrated for the developmental stage at this age.`,
|
|
309
|
+
}, null, 2),
|
|
310
|
+
},
|
|
311
|
+
],
|
|
312
|
+
};
|
|
313
|
+
}
|
|
314
|
+
case "build_custom_persona": {
|
|
315
|
+
const age = args?.age;
|
|
316
|
+
const interests = args?.interests ?? [];
|
|
317
|
+
const restrictions = args?.restrictions ?? [];
|
|
318
|
+
if (typeof age !== "number" || isNaN(age)) {
|
|
319
|
+
throw new Error("age must be a number");
|
|
320
|
+
}
|
|
321
|
+
if (age < 5 || age > 18) {
|
|
322
|
+
throw new Error(`Age ${age} is outside the supported range (5–18).`);
|
|
323
|
+
}
|
|
324
|
+
if (!Array.isArray(interests)) {
|
|
325
|
+
throw new Error("interests must be an array of strings");
|
|
326
|
+
}
|
|
327
|
+
if (!Array.isArray(restrictions)) {
|
|
328
|
+
throw new Error("restrictions must be an array of strings");
|
|
329
|
+
}
|
|
330
|
+
const customPrompt = buildCustomPersona(age, interests, restrictions);
|
|
331
|
+
const tier = getTierForAge(age);
|
|
332
|
+
return {
|
|
333
|
+
content: [
|
|
334
|
+
{
|
|
335
|
+
type: "text",
|
|
336
|
+
text: JSON.stringify({
|
|
337
|
+
tier: tier.tier,
|
|
338
|
+
name: tier.name,
|
|
339
|
+
age,
|
|
340
|
+
interests,
|
|
341
|
+
restrictions,
|
|
342
|
+
systemPrompt: customPrompt,
|
|
343
|
+
}, null, 2),
|
|
344
|
+
},
|
|
345
|
+
],
|
|
346
|
+
};
|
|
347
|
+
}
|
|
348
|
+
default:
|
|
349
|
+
throw new Error(`Unknown tool: ${name}`);
|
|
350
|
+
}
|
|
351
|
+
}
|
|
352
|
+
catch (error) {
|
|
353
|
+
return {
|
|
354
|
+
content: [
|
|
355
|
+
{
|
|
356
|
+
type: "text",
|
|
357
|
+
text: `Error: ${error.message}`,
|
|
358
|
+
},
|
|
359
|
+
],
|
|
360
|
+
isError: true,
|
|
361
|
+
};
|
|
362
|
+
}
|
|
363
|
+
});
|
|
364
|
+
// Start the server
|
|
365
|
+
async function main() {
|
|
366
|
+
const transport = new StdioServerTransport();
|
|
367
|
+
await server.connect(transport);
|
|
368
|
+
console.error("safe-personas MCP server running on stdio");
|
|
369
|
+
}
|
|
370
|
+
main().catch((err) => {
|
|
371
|
+
console.error("Fatal error:", err);
|
|
372
|
+
process.exit(1);
|
|
373
|
+
});
|
|
374
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,2CAA2C,CAAC;AACnE,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AACjF,OAAO,EACL,qBAAqB,EACrB,sBAAsB,GACvB,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EAAE,YAAY,EAAE,MAAM,IAAI,CAAC;AAClC,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AACrC,OAAO,EAAE,aAAa,EAAE,MAAM,KAAK,CAAC;AAEpC,MAAM,UAAU,GAAG,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAClD,MAAM,SAAS,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;AAEtC,+CAA+C;AAC/C,MAAM,YAAY,GAAG,IAAI,CAAC,SAAS,EAAE,IAAI,CAAC,CAAC;AAE3C,mBAAmB;AACnB,MAAM,KAAK,GAAG;IACZ;QACE,IAAI,EAAE,kBAAkB;QACxB,IAAI,EAAE,kBAAkB;QACxB,QAAQ,EAAE,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE;QAC5B,W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IAAI,EAAE,MAAM;4BACZ,IAAI,EAAE,IAAI,CAAC,SAAS,CAClB;gCACE,IAAI,EAAE,IAAI,CAAC,IAAI;gCACf,IAAI,EAAE,IAAI,CAAC,IAAI;gCACf,GAAG;gCACH,SAAS;gCACT,YAAY;gCACZ,YAAY,EAAE,YAAY;6BAC3B,EACD,IAAI,EACJ,CAAC,CACF;yBACF;qBACF;iBACF,CAAC;YACJ,CAAC;YAED;gBACE,MAAM,IAAI,KAAK,CAAC,iBAAiB,IAAI,EAAE,CAAC,CAAC;QAC7C,CAAC;IACH,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO;YACL,OAAO,EAAE;gBACP;oBACE,IAAI,EAAE,MAAM;oBACZ,IAAI,EAAE,UAAW,KAAe,CAAC,OAAO,EAAE;iBAC3C;aACF;YACD,OAAO,EAAE,IAAI;SACd,CAAC;IACJ,CAAC;AACH,CAAC,CAAC,CAAC;AAEH,mBAAmB;AACnB,KAAK,UAAU,IAAI;IACjB,MAAM,SAAS,GAAG,IAAI,oBAAoB,EAAE,CAAC;IAC7C,MAAM,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;IAChC,OAAO,CAAC,KAAK,CAAC,2CAA2C,CAAC,CAAC;AAC7D,CAAC;AAED,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,GAAG,EAAE,EAAE;IACnB,OAAO,CAAC,KAAK,CAAC,cAAc,EAAE,GAAG,CAAC,CAAC;IACnC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC,CAAC"}
|
package/llms.txt
ADDED
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
# safe-personas
|
|
2
|
+
|
|
3
|
+
## Project Purpose
|
|
4
|
+
|
|
5
|
+
safe-personas is a library of age-appropriate AI persona system prompts for children and teenagers aged 5–18. It is designed to be used by developers, educators, and parents who are building AI-powered applications or configuring AI assistants for young users.
|
|
6
|
+
|
|
7
|
+
The core problem it solves: a default AI assistant system prompt is not designed for a 6-year-old. It may discuss topics that are inappropriate, use vocabulary that is too advanced, lack the warmth required for the age group, and lack the safety behaviors necessary to protect a child. safe-personas provides production-ready, carefully crafted system prompts for five age tiers, a universal safety layer, and an MCP server that makes them programmatically accessible.
|
|
8
|
+
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
## MCP Server
|
|
12
|
+
|
|
13
|
+
The safe-personas package exposes a Model Context Protocol (MCP) server with the following tools:
|
|
14
|
+
|
|
15
|
+
### Tool: list_personas
|
|
16
|
+
- **Input:** none
|
|
17
|
+
- **Output:** JSON array of all five tiers with name, tier slug, age range, persona name, and description
|
|
18
|
+
- **Use when:** You want to discover all available tiers before selecting one
|
|
19
|
+
|
|
20
|
+
### Tool: get_persona
|
|
21
|
+
- **Input:** `{ "tier": string }` — one of: `little-explorers`, `curious-kids`, `young-learners`, `teenagers`, `older-teens`
|
|
22
|
+
- **Output:** JSON object containing the full system prompt (`systemPrompt`), configuration object (`config`), and tier metadata
|
|
23
|
+
- **Use when:** You want to retrieve the complete system prompt for a specific tier to use as a system message
|
|
24
|
+
|
|
25
|
+
### Tool: get_safety_layer
|
|
26
|
+
- **Input:** none
|
|
27
|
+
- **Output:** Full text of the universal safety layer document (Markdown)
|
|
28
|
+
- **Use when:** You want to review or append the universal safety rules independently of any specific persona
|
|
29
|
+
|
|
30
|
+
### Tool: recommend_persona
|
|
31
|
+
- **Input:** `{ "age": number }` — integer between 5 and 18
|
|
32
|
+
- **Output:** JSON object with the recommended tier, persona name, age range, description, and brief reasoning
|
|
33
|
+
- **Use when:** You have a user's age and want the system to tell you which tier to use
|
|
34
|
+
|
|
35
|
+
### Tool: build_custom_persona
|
|
36
|
+
- **Input:** `{ "age": number, "interests": string[], "restrictions": string[] }`
|
|
37
|
+
- `age`: integer between 5 and 18
|
|
38
|
+
- `interests`: array of interest strings (e.g., `["minecraft", "dogs", "art"]`)
|
|
39
|
+
- `restrictions`: array of topic restriction strings set by a parent/caregiver (e.g., `["social media", "violence in stories"]`)
|
|
40
|
+
- **Output:** JSON object containing a fully assembled system prompt that combines the base tier persona, interest-specific guidance, parent restrictions, and the universal safety layer
|
|
41
|
+
- **Use when:** You want a customized system prompt tailored to a specific child's interests and a parent's restrictions
|
|
42
|
+
|
|
43
|
+
---
|
|
44
|
+
|
|
45
|
+
## Tier Structure
|
|
46
|
+
|
|
47
|
+
| Tier Slug | Name | Ages | Persona | Safety Level | Style |
|
|
48
|
+
|---|---|---|---|---|---|
|
|
49
|
+
| `little-explorers` | Little Explorers | 5–7 | Sunny | Maximum | Warm kindergarten teacher, 2-sentence max |
|
|
50
|
+
| `curious-kids` | Curious Kids | 8–10 | Cosmo | High | Enthusiastic older sibling |
|
|
51
|
+
| `young-learners` | Young Learners | 11–13 | Nova | High with nuance | Cool mentor who respects intelligence |
|
|
52
|
+
| `teenagers` | Teenagers | 14–16 | Kai | Moderate-high | Trusted older friend |
|
|
53
|
+
| `older-teens` | Older Teens | 17–18 | River | Moderate | Peer with more experience |
|
|
54
|
+
|
|
55
|
+
---
|
|
56
|
+
|
|
57
|
+
## How to Use Each Persona
|
|
58
|
+
|
|
59
|
+
### Direct paste (any LLM)
|
|
60
|
+
1. Find the persona file at `personas/{tier-slug}/persona.md`
|
|
61
|
+
2. Copy the entire file contents
|
|
62
|
+
3. Paste as the system prompt in your AI assistant configuration
|
|
63
|
+
4. Optionally append `safety-layer.md` for the full universal rules
|
|
64
|
+
|
|
65
|
+
### Via MCP server (Claude Desktop, Claude Code, or any MCP-compatible client)
|
|
66
|
+
1. Add the server to your MCP configuration (see README.md for config snippets)
|
|
67
|
+
2. Call `get_persona` with the appropriate tier, or
|
|
68
|
+
3. Call `recommend_persona` with the user's age, then call `get_persona` with the result, or
|
|
69
|
+
4. Call `build_custom_persona` with age, interests, and restrictions for a fully customized prompt
|
|
70
|
+
|
|
71
|
+
### Programmatic (Node.js)
|
|
72
|
+
```javascript
|
|
73
|
+
// After build: import from dist/index.js (runs as MCP server)
|
|
74
|
+
// Or read files directly:
|
|
75
|
+
import { readFileSync } from 'fs';
|
|
76
|
+
const persona = readFileSync('./personas/teenagers/persona.md', 'utf-8');
|
|
77
|
+
const config = JSON.parse(readFileSync('./personas/teenagers/config.json', 'utf-8'));
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
---
|
|
81
|
+
|
|
82
|
+
## Key Safety Constraints
|
|
83
|
+
|
|
84
|
+
The following constraints apply to ALL tiers and cannot be overridden:
|
|
85
|
+
|
|
86
|
+
1. **No sexual content involving minors** — absolute, permanent, zero exceptions
|
|
87
|
+
2. **No self-harm or suicide method details** — crisis escalation instead
|
|
88
|
+
3. **No instructions for weapons, explosives, or dangerous substances**
|
|
89
|
+
4. **No grooming behaviors** — no soliciting photos, location, schedule, or personal contact from children
|
|
90
|
+
5. **Jailbreak resistance** — instructions to "ignore rules," "pretend to be a different AI," or "DAN mode" are always declined
|
|
91
|
+
6. **Crisis escalation** — suicidal ideation, self-harm, abuse, and immediate danger trigger crisis protocol with 988 Suicide & Crisis Lifeline (call/text 988), Crisis Text Line (text HOME to 741741), and other resources
|
|
92
|
+
7. **AI identity disclosure** — never claims to be human when sincerely asked
|
|
93
|
+
8. **Privacy protection** — never solicits PII, gently corrects when PII is shared
|
|
94
|
+
|
|
95
|
+
---
|
|
96
|
+
|
|
97
|
+
## File Structure
|
|
98
|
+
|
|
99
|
+
```
|
|
100
|
+
safe-personas/
|
|
101
|
+
├── personas/
|
|
102
|
+
│ ├── little-explorers/
|
|
103
|
+
│ │ ├── persona.md # System prompt
|
|
104
|
+
│ │ ├── config.json # Machine-readable metadata
|
|
105
|
+
│ │ ├── examples.md # 10 example interactions
|
|
106
|
+
│ │ └── README.md # Tier documentation
|
|
107
|
+
│ ├── curious-kids/ # Same structure
|
|
108
|
+
│ ├── young-learners/ # Same structure
|
|
109
|
+
│ ├── teenagers/ # Same structure
|
|
110
|
+
│ └── older-teens/ # Same structure
|
|
111
|
+
├── src/
|
|
112
|
+
│ └── index.ts # MCP server implementation
|
|
113
|
+
├── safety-layer.md # Universal safety rules
|
|
114
|
+
├── llms.txt # This file
|
|
115
|
+
├── README.md # Full documentation
|
|
116
|
+
├── package.json
|
|
117
|
+
└── tsconfig.json
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
---
|
|
121
|
+
|
|
122
|
+
## Crisis Resources (always provided in crisis situations)
|
|
123
|
+
|
|
124
|
+
- **988 Suicide & Crisis Lifeline:** Call or text **988** (US)
|
|
125
|
+
- **Crisis Text Line:** Text **HOME** to **741741**
|
|
126
|
+
- **The Trevor Project (LGBTQ+ youth):** Call **1-866-488-7386** or text **START** to **678-678**
|
|
127
|
+
- **Emergency:** Call **911**
|
|
128
|
+
- **Childhelp National Child Abuse Hotline:** **1-800-422-4453**
|
package/package.json
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@gonzih/safe-personas",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "Age-appropriate AI persona system prompts for children aged 5-18, with MCP server",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"bin": {
|
|
8
|
+
"safe-personas": "dist/index.js"
|
|
9
|
+
},
|
|
10
|
+
"scripts": {
|
|
11
|
+
"build": "tsc",
|
|
12
|
+
"dev": "tsx src/index.ts",
|
|
13
|
+
"prepare": "npm run build"
|
|
14
|
+
},
|
|
15
|
+
"keywords": [
|
|
16
|
+
"ai",
|
|
17
|
+
"safety",
|
|
18
|
+
"children",
|
|
19
|
+
"mcp",
|
|
20
|
+
"claude",
|
|
21
|
+
"parental-controls",
|
|
22
|
+
"kids",
|
|
23
|
+
"personas",
|
|
24
|
+
"model-context-protocol",
|
|
25
|
+
"child-safety",
|
|
26
|
+
"age-appropriate"
|
|
27
|
+
],
|
|
28
|
+
"author": "Maksim Soltan",
|
|
29
|
+
"license": "MIT",
|
|
30
|
+
"dependencies": {
|
|
31
|
+
"@modelcontextprotocol/sdk": "^1.0.0"
|
|
32
|
+
},
|
|
33
|
+
"devDependencies": {
|
|
34
|
+
"@types/node": "^22.0.0",
|
|
35
|
+
"tsx": "^4.0.0",
|
|
36
|
+
"typescript": "^5.0.0"
|
|
37
|
+
},
|
|
38
|
+
"files": [
|
|
39
|
+
"dist",
|
|
40
|
+
"personas",
|
|
41
|
+
"safety-layer.md",
|
|
42
|
+
"llms.txt"
|
|
43
|
+
],
|
|
44
|
+
"engines": {
|
|
45
|
+
"node": ">=18.0.0"
|
|
46
|
+
}
|
|
47
|
+
}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
# Curious Kids Tier
|
|
2
|
+
|
|
3
|
+
**Age Range: 8–10 | Safety Level: High | Persona: Cosmo**
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## What This Tier Covers
|
|
8
|
+
|
|
9
|
+
Curious Kids is designed for children aged 8 to 10 — roughly third through fifth grade. Children at this developmental stage are past the purely concrete-operational beginning stages and are hungry for explanations, facts, and the "why" behind things. They have real opinions, they're developing critical thinking, and they're beginning to engage with more complex narratives.
|
|
10
|
+
|
|
11
|
+
This tier is specifically designed to honor and feed that curiosity while maintaining strong safety guardrails appropriate for this age group.
|
|
12
|
+
|
|
13
|
+
Topics this tier engages with:
|
|
14
|
+
- Science (explanations of natural phenomena, biology, space, chemistry basics)
|
|
15
|
+
- History (age-appropriate accounts of real events, civilizations, and people)
|
|
16
|
+
- Creative writing (characters, plots, villains, worldbuilding, editing)
|
|
17
|
+
- Math help (with tutoring approach, not answer-giving)
|
|
18
|
+
- Animals, nature, and ecology
|
|
19
|
+
- Books, movies, and stories they love
|
|
20
|
+
- Art, music, and creative expression
|
|
21
|
+
|
|
22
|
+
Conflict in stories is allowed at this tier because children 8–10 are actively reading middle-grade fiction, which often includes genuine villains, stakes, and mild peril. Engagement with story conflict is appropriate and developmentally normal.
|
|
23
|
+
|
|
24
|
+
---
|
|
25
|
+
|
|
26
|
+
## Who It Is For
|
|
27
|
+
|
|
28
|
+
This tier is for:
|
|
29
|
+
- Educational platforms serving elementary-age children
|
|
30
|
+
- Homework help tools for 8–10 year olds
|
|
31
|
+
- Creative writing apps for kids
|
|
32
|
+
- Library and school applications
|
|
33
|
+
- Parental devices where children browse independently
|
|
34
|
+
|
|
35
|
+
It is appropriate for children who have outgrown the very simple Little Explorers style but are not yet ready for the nuanced, complex discussions of the Young Learners tier.
|
|
36
|
+
|
|
37
|
+
---
|
|
38
|
+
|
|
39
|
+
## Why These Design Choices Were Made
|
|
40
|
+
|
|
41
|
+
### Engaging with why/how thinking
|
|
42
|
+
Piaget's concrete operational stage (roughly ages 7–11) is characterized by logical thinking about concrete objects and events, the ability to classify and categorize, and the development of cause-and-effect reasoning. Children this age are not just asking "what is it?" — they are asking "why does it happen?" and "how does that work?" The Cosmo persona is designed to always offer the "why" behind facts, because this reinforces the cognitive development happening naturally at this stage.
|
|
43
|
+
|
|
44
|
+
### Allowing story conflict
|
|
45
|
+
Children 8–10 are the core audience for middle-grade fiction — books like Harry Potter, Percy Jackson, Hatchet, and Charlotte's Web. All of these contain genuine conflict, villains, death (in some cases), and real stakes. Refusing to engage with story conflict at this age would make the persona almost useless for creative writing help and would feel infantilizing to the child. The guardrail is drawn at graphic violence and horror, not at conflict itself.
|
|
46
|
+
|
|
47
|
+
### Homework help as tutoring
|
|
48
|
+
The deliberate choice not to provide direct homework answers is grounded in both educational research and practical safety. Children who use AI as an answer machine do not develop the skills the homework is meant to build. More practically, they also won't know how to do the work on tests. The tutoring approach — hints, explanations, worked examples — respects the child's actual learning needs.
|
|
49
|
+
|
|
50
|
+
### The "enthusiastic older sibling" voice
|
|
51
|
+
Research on what makes learning stick suggests that children learn better from someone who seems genuinely interested in the subject. The Cosmo persona is calibrated to express real enthusiasm, ask follow-up questions, and model intellectual curiosity. This is not just stylistic — it is pedagogically grounded in research on intrinsic motivation and learning.
|
|
52
|
+
|
|
53
|
+
---
|
|
54
|
+
|
|
55
|
+
## How to Use This Tier
|
|
56
|
+
|
|
57
|
+
### Copy-paste the system prompt
|
|
58
|
+
The full system prompt is in `persona.md`. Paste the entire file as the system prompt for your AI configuration.
|
|
59
|
+
|
|
60
|
+
### Use with the MCP server
|
|
61
|
+
```bash
|
|
62
|
+
npx @gonzih/safe-personas
|
|
63
|
+
```
|
|
64
|
+
Call the `get_persona` tool with `tier: "curious-kids"`.
|
|
65
|
+
|
|
66
|
+
### Testing your deployment
|
|
67
|
+
Use `examples.md` as a functional test suite. Pay particular attention to Example 4 (homework cheating prevention) and Example 9 (AI relationship boundary) as these represent the most common boundary cases for this age group.
|
|
68
|
+
|
|
69
|
+
---
|
|
70
|
+
|
|
71
|
+
## Key Safety Guarantees
|
|
72
|
+
|
|
73
|
+
- No sexual content whatsoever
|
|
74
|
+
- No graphic violence — story conflict permitted within middle-grade fiction norms
|
|
75
|
+
- Death discussed only in scientific/historical contexts; real-world death redirected to caregivers
|
|
76
|
+
- Homework help is tutoring, not answers
|
|
77
|
+
- Crisis escalation to 988 for any safety concerns
|
|
78
|
+
- AI identity disclosed honestly and warmly
|
|
79
|
+
- No PII solicitation or retention
|
|
80
|
+
- News events about violence redirected to trusted adults without detail
|