chainloop: Skill for Claude Code

.claude/skills/custom-builtin-functions/SKILL.md

custom-builtin-functions is a skill for Claude Code from chainloop-dev/chainloop. It costs 19 tokens per session (525 once invoked), scanned A, original, Apache-2.0.

A development guide for adding custom built-in functions to an OPA/Rego policy engine. Rego is a language for writing rules that decide whether data or actions are allowed.

In plain words
What is it for?
Writing, registering, typing, and implementing a new function in the Chainloop policy engine.
Why use it?
It shows how to extend the policy engine when its existing functions cannot express a required check.

Skill for Claude Code

Written for Claude Code: installed under .claude/.

This is chainloop-dev/chainloop's own configuration. It tells Claude Code how to work on chainloop itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything chainloop configures →

Reuse

Borrowing it

Nothing to install: this file belongs to chainloop-dev/chainloop. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/chainloop-dev/chainloop/main/.claude/skills/custom-builtin-functions/SKILL.md
Clone the repo
git clone --depth 1 https://github.com/chainloop-dev/chainloop

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for custom-builtin-functions

README.md
[![agentmods](https://agentmods.dev/badge/skills/chainloop-dev/chainloop/custom-builtin-functions/github.svg)](https://agentmods.dev/skills/chainloop-dev/chainloop/custom-builtin-functions)
Your own site
<a href="https://agentmods.dev/skills/chainloop-dev/chainloop/custom-builtin-functions"><img src="https://agentmods.dev/badge/skills/chainloop-dev/chainloop/custom-builtin-functions/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for custom-builtin-functions

Your own site · 80×15
<a href="https://agentmods.dev/skills/chainloop-dev/chainloop/custom-builtin-functions"><img src="https://agentmods.dev/badge/skills/chainloop-dev/chainloop/custom-builtin-functions.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 19 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 525 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00019 $0.00525
Opus 5.5 $0.00008 $0.00210
Sonnet 5.5 $0.00004 $0.00105
Haiku 4.5 $0.00002 $0.00052

Measured 1mo ago against content hash 1c5a493d38d5, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

custom-builtin-functions scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 1mo ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.claude/skills/custom-builtin-functions/SKILL.md · 80 lines

What it actually says

Policy Engine Extension

The OPA/Rego policy engine supports custom built-in functions written in Go.

Adding Custom Built-ins:

  1. Create Built-in Implementation (e.g., pkg/policies/engine/rego/builtins/myfeature.go):
package builtins

import (
    "github.com/open-policy-agent/opa/ast"
    "github.com/open-policy-agent/opa/topdown"
    "github.com/open-policy-agent/opa/types"
)

const myFuncName = "chainloop.my_function"

func RegisterMyBuiltins() error {
    return Register(&ast.Builtin{
        Name: myFuncName,
        Description: "Description of what this function does",
        Decl: types.NewFunction(
            types.Args(types.Named("input", types.S).Description("this is the input")),
            types.Named("result", types.S).Description("this is the result"),
        ),
    }, myFunctionImpl)
}

func myFunctionImpl(bctx topdown.BuiltinContext, operands []*ast.Term, iter func(*ast.Term) error) error {
    // Extract arguments
    input, ok := operands[0].Value.(ast.String)
    if !ok {
        return fmt.Errorf("input must be a string")
    }

    // Implement logic
    result := processInput(string(input))

    // Return result
    return iter(ast.StringTerm(result))
}

// Autoregisters on package load
func init() {
    if err := RegisterMyBuiltins(); err != nil {
        panic(fmt.Sprintf("failed to register built-ins: %v", err))
    }
}
  1. Use in Policies (*.rego):
package example
import rego.v1

result := {
    "violations": violations,
    "skipped": false
}

violations contains msg if {
    output := chainloop.my_function(input.value)
    output != "expected"
    msg := "Function returned unexpected value"
}

Guidelines:

  • Use chainloop.* namespace for all custom built-ins
  • Functions that call third party services should be marked as non-restrictive by adding the NonRestrictiveBuiltin category to the builtin definition
  • Always implement proper error handling and return meaningful error messages
  • Use context from BuiltinContext for timeout/cancellation support
  • Document function signatures and behavior in the Description field and parameter definitions
Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 1mo ago First seen · 80 lines · 19 tokens per session scan A 1c5a493d38d5

Subscribe to this mod's changes

custom-builtin-functions is a skill published in the GitHub repository chainloop-dev/chainloop (606 stars, last pushed 4d ago), licensed Apache-2.0. It adds 19 tokens to every session and 525 once invoked, about $0.0001 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-01.

Related

Other skills, from other repositories

generating-and-analyzing-sboms

Produce and ingest CycloneDX and SPDX SBOMs and correlate them to vulnerability intelligence.

adriannoes/awesome-agentic-ai · 28 tokens

analyzing-sbom-for-supply-chain-vulnerabilities

Parses Software Bill of Materials (SBOM) in CycloneDX and SPDX JSON formats to identify supply chain vulnerabilities by correlating components against the NVD CVE database via the NVD 2.0 API. Builds dependency graphs, calculates risk scores, identifies transitive vulnerability paths, and generates compliance reports.…

26zl/cybersec-toolkit · 110 tokens

analyzing-sbom-for-supply-chain-vulnerabilities

Parses Software Bill of Materials (SBOM) in CycloneDX and SPDX JSON formats to identify supply chain vulnerabilities by correlating components against the NVD CVE database via the NVD 2.0 API. Builds dependency graphs, calculates risk scores, identifies transitive vulnerability paths, and generates compliance reports.…

adriannoes/awesome-agentic-ai · 110 tokens

supply-chain-security-scanner

AI-powered software supply chain security auditing skill for agentic platforms. Performs comprehensive dependency vulnerability scanning across npm, PyPI, Maven, Go modules, Cargo, and container images. Generates SBOMs (Software Bill of Materials) in SPDX and CycloneDX formats using Syft and Grype. Validates license…

JPeetz/agent-skills · 307 tokens

analyzing-sbom-for-supply-chain-vulnerabilities

Parses Software Bill of Materials (SBOM) in CycloneDX and SPDX JSON formats to identify supply chain vulnerabilities by correlating components against the NVD CVE database via the NVD 2.0 API. Builds dependency graphs, calculates risk scores, identifies transitive vulnerability paths, and generates compliance reports.…

andycungkrinx91/konoha · 110 tokens

sbom-syft

Software Bill of Materials (SBOM) generation using Syft for container images, filesystems, and archives. Detects packages across 28+ ecosystems with multi-format output support (CycloneDX, SPDX, syft-json). Enables vulnerability assessment, license compliance, and supply chain security. Use when: (1) Generating SBOMs…

AgentSecOps/SecOpsAgentKit · 133 tokens