Koog 1.3 idioms, gotchas, and scaffolding skills for Kotlin agents on the JVM
72
91%
Does it follow best practices?
Run evals on this skill
Adds up to 20 points to the overall score
Low
Low-risk findings worth noting
Register ConfinedSkillFiles(skillsRoot) as a ToolSet when reads must stay under
one trusted root. Paths are absolute; traversal and symlink escapes are rejected.
import ai.koog.agents.core.tools.annotations.Tool
import ai.koog.agents.core.tools.reflect.ToolSet
import java.nio.file.Files
import java.nio.file.Path
class ConfinedSkillFiles(root: Path) : ToolSet {
private val allowedRoot = root.toRealPath()
private fun checkedPath(path: String): Path {
val requested = Path.of(path)
require(requested.isAbsolute) { "Use an absolute skill path" }
val canonical = requested.toRealPath()
require(canonical.startsWith(allowedRoot)) { "Choose an existing path beneath the allowed skills root" }
return canonical
}
@Tool
fun readSkill(path: String): String = Files.readString(checkedPath(path))
@Tool
fun listSkills(path: String): List<String> = Files.list(checkedPath(path)).use { entries ->
entries.map { checkedPath(it.toString()).toString() }.sorted().toList()
}
}The root must exist before construction. Use this tool set for reads and listings; do not also register an unrestricted filesystem reader. Keep discovered paths and this tool set's root aligned.
Canonicalization checks a path before opening it. A concurrent filesystem writer can race that check. Use an OS sandbox or a separate process with restricted mounts for attacker-controlled files; this helper is for a trusted, stable filesystem.
.tessl-plugin
skills
add-observability
add-persistence
references
add-rag
add-structured-output
add-token-budgeting
add-tool
cache-llm-calls
define-prompt
domain-model-subtask-pipeline
references
enable-prompt-caching
handle-agent-events
manage-state
migrate-from-0-x
model-planner-subtasks
persist-chat-history
query-sql-from-agent
scaffold-agent
snapshot-and-restore
references
test-koog-agents
trace-agent-internals
use-agent-skills
references
use-attachments
use-cli-agents
use-functional-agent
use-llm-node-variants
use-planner
wire-a2a
wire-acp-server
wire-ktor-server
wire-mcp-server
wire-spring-boot