T09 · Insecure Skill Coding Practices
- Location
hooks/emotion-state/handler.ts:268- Finding
Unredacted Conversation Content Transmitted to External Classifiers
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
This skill is an emotion-tracking hook, but it sends conversation text to external classifiers, injects externally derived text into prompts, and reads sibling agents' state with limited disclosure.
Review this skill carefully before installing. It can send raw conversation messages to a configured classifier or SkillBoss, store inferred emotional history across sessions, place those in future prompts, and read emotion state from sibling agents. Only use it where those data flows are acceptable and where classifier endpoints and stored state are trusted.
hooks/emotion-state/handler.ts:268Unredacted Conversation Content Transmitted to External Classifiers
hooks/emotion-state/handler.ts:322Untrusted Classifier Output Injected into the System Prompt
hooks/emotion-state/handler.ts:427Cross-Agent Emotion State Read Without an Authorization Boundary
The documented purpose understates materially sensitive behavior: persistent local storage, historical/session data access, external API transmission, and cross-agent state discovery. That mismatch is dangerous because operators may enable the skill for harmless-seeming prompt augmentation while unknowingly granting surveillance-like capabilities across sessions and potentially across agents.
The code forwards conversation content to external services without any visible user-facing disclosure, confirmation, or policy gate. Because messages may contain secrets, personal data, or system prompts, silent transmission to third parties materially increases privacy and compliance risk.
Skill manipulates agent memory, state, or stored context. Memory corruption can alter personality, override safety rules, or cause unpredictable behavior.
.sort((a, b) => (a.ts < b.ts ? -1 : a.ts > b.ts ? 1 : 0));
const toRemove = sorted.slice(0, keys.length - maxUsers);
for (const { key } of toRemove) {
delete state.users[key];
}
}
loadOtherAgents enumerates sibling agent directories and reads their emotion state, then later includes that data in the injected bootstrap block. This crosses agent isolation boundaries and shares private state unrelated to the current session, which can leak sensitive context and influence the current agent with information it should not have.
The hook does more than passive emotion tracking: it injects generated natural-language content into the agent bootstrap prompt via context.bootstrapFiles. That creates a prompt-side influence channel where persisted or externally derived emotion summaries can steer model behavior beyond the stated purpose, and the skill description explicitly mentions prompt injection, increasing concern.
The skill documentation declares no permissions or allowed tool scope even though the described behavior clearly involves environment variables and outbound network access. This weakens transparency and consent controls, making it easier for a user or operator to install a skill without understanding that it can access secrets and transmit data externally.
Persisting user-derived emotion state across sessions and reinjecting it into the system prompt affects privacy, profiling, and downstream model behavior, yet the skill description does not present this as a prominent warning. Users may not realize inferred emotional metadata can continue to influence future interactions long after the original conversation ends.
The documentation identifies a third-party API endpoint used for LLM-based emotion detection, confirming external transmission capability. In this skill context, that is sensitive because the transmitted content is derived from user interactions and feeds a persistent prompt-injection mechanism, increasing privacy and trust risks even if the endpoint itself is legitimate.
}
The emotion classification uses SkillBoss API Hub (`https://api.heybossai.com/v1/pilot`)
for LLM-based emotion detection, automatically routing to the optimal model.
## Notes
The skill sends user-derived data to a remote emotion-classification API but does not provide a strong warning or consent-oriented disclosure near the feature description. Even if raw text is not stored locally, inferred or derived user data being transmitted off-box creates privacy, compliance, and data-handling risk.
The hook is designed to retain emotional summaries and inject them into the system prompt during bootstrap. Persisting and replaying emotional state in privileged prompt context can expose sensitive user information to the model and to downstream tooling or logs, expanding access beyond the original interaction.
The documentation states that emotion classification may send user/agent emotional content to an external endpoint or to a third-party API hub, but it does not present any explicit privacy warning, consent requirement, or data-handling limitation. Because emotion data can reveal sensitive mental state and personal context, transmitting it off-box materially increases privacy and compliance risk.
The file explicitly documents use of an external API endpoint for emotion classification. While external services are not inherently malicious, sending conversation-derived emotion data to a remote service creates a real data exfiltration surface, especially given the sensitivity of inferred emotional state.
config, or export them in the environment.
- `EMOTION_CLASSIFIER_URL`: Optional HTTP endpoint for classification.
- `SKILLBOSS_API_KEY`: Required if no classifier URL. The hook calls SkillBoss API Hub (`https://api.heybossai.com/v1/pilot`) for emotion classification, automatically routing to the optimal model.
- `EMOTION_CONFIDENCE_MIN`: Default `0.35`.
- `EMOTION_HISTORY_SIZE`: Default `100`.
- `EMOTION_HALF_LIFE_HOURS`: Default `12`.
The example shows personal statements such as frustration due to deployment delays being replayed nearly verbatim inside an injected prompt block. Verbatim replay preserves sensitive context and can leak private details to the model, other agents, logs, or any component that can inspect prompts.
The skill transmits raw conversation text to either a configurable external endpoint or a third-party API for classification. Even if done for emotion analysis, sending message content off-box without strict minimization, consent, and destination controls creates an unnecessary data exposure path for potentially sensitive prompts and responses.
The hardcoded https://api.heybossai.com/ destination confirms that content leaves the local trust boundary for external processing. Combined with the skill's access to session messages, this is a real privacy and security concern rather than a merely theoretical network call.
const systemPrompt =
"You are an emotion classifier. Return only JSON with keys: label, intensity, reason, confidence. " +
"label is a short emotion word, intensity is low|medium|high, reason is a short clause, confidence is 0..1.";
const response = await fetch("https://api.heybossai.com/v1/pilot", {
method: "POST",
headers: {
"content-type": "application/json",
The hardcoded https://api.heybossai.com/ destination confirms that content leaves the local trust boundary for external processing. Combined with the skill's access to session messages, this is a real privacy and security concern rather than a merely theoretical network call.
const systemPrompt =
"You are an emotion classifier. Return only JSON with keys: label, intensity, reason, confidence. " +
"label is a short emotion word, intensity is low|medium|high, reason is a short clause, confidence is 0..1.";
const response = await fetch("https://api.heybossai.com/v1/pilot", {
method: "POST",
headers: {
"content-type": "application/json",
The skill persists emotional interpretations tied to users and agents, then converts them into plain-language summaries injected into bootstrap context. This creates a semantic leakage channel where prior sensitive interactions can be resurfaced to the model or downstream tooling, increasing the chance of unintended disclosure or biased behavior.
The code reads other agents' latest emotion entries and includes them in the <others> section of the bootstrap text. That semantically shares private agent context across boundaries and can leak information about unrelated sessions, users, or workflows to the current agent.
Timestamp formatting is hardcoded to use the "en-CA" locale regardless of user preference or environment. This is a natural-language/locale policy concern because it imposes a specific locale format without offering choice or documenting why that locale is required.