ktgbotapi-patterns
Pass
Audited by Gen Agent Trust Hub on Oct 9, 2026
Risk Level: SAFEINDIRECT_PROMPT_INJECTION
Full Analysis
- [INDIRECT_PROMPT_INJECTION]: The skill provides templates for building interactive Telegram bots, which inherently ingest untrusted user input.
- Ingestion points: Untrusted data enters the application through
onText,onCommand, andonDataCallbackQueryhandlers inhandlers/CommandHandlers.ktandhandlers/MessageHandlers.kt. - Boundary markers: The architecture separates message content from execution logic using handlers and state machines (FSM), though it relies on the developer to properly escape or sanitize output.
- Capability inventory: Bots built with these patterns can perform network requests via
HttpClient, interact with the Telegram API, and execute business logic inUserService.kt. - Sanitization: The patterns include basic validation examples (e.g., checking email format with
contains("@")and name length) and security-relevant utility functions likeisAdminto gate privileged operations. - [SAFE]: The skill correctly handles sensitive information by using
System.getenv("BOT_TOKEN")andgetProperty("API_KEY")instead of hardcoding secrets. - [SAFE]: Includes defensive patterns such as a
RateLimiterto prevent abuse and awithErrorHandlingwrapper to ensure the bot remains stable and provides user-friendly error messages.
Audit Metadata