Przejdź do treści
Biblioteka skilli
Bezpieczeństwo · Przegląd i audyt

spring-ai-security

/spring-ai-security

Analizuje i wzmacnia workflow Spring AI pod kątem wstrzyknięć promptu i nadmiernych uprawnień.

Licencja
MIT
Ostatnia zmiana repozytorium
11.11.2026

Ocena i bezpieczeństwo

100/ 100Klasa: dobry
Format25 / 25
Frontmatter z nazwą i opisem, poprawna nazwa, opis do 1024 znaków, nazwa zgodna z folderem.
Odkrywalność25 / 25
Opis mówi, kiedy użyć skilla, ma sensowną długość i jest w 3. osobie.
Treść35 / 35
Co najmniej 150 słów i do 500 linii, nagłówki, listy kroków, przykłady albo kod.
Higiena15 / 15
Bez zaślepek typu TODO, bez ścieżek Windows, z licencją.
Ryzykobrak sygnałów w skanie
Pliki w paczce
5
Skrypty
1
Komentarze HTML
0
Adresy URL w SKILL.md
3
Przestarzałość

Brak sygnałów. Repozytorium zmienione 11.11.2026, bez odwołań do wycofanych modeli i API.

Licencja

MIT, otwarta: można używać i zmieniać, z zachowaniem informacji o autorze.

Co sprawdzić przed instalacją
  • 1 skrypt w paczce. Przejrzyj je przed instalacją, bo Claude może je uruchomić.

Skrypty: templates/DocumentReadTool.java

Co robi i kiedy

Analizuje i wzmacnia workflow Spring AI pod kątem wstrzyknięć promptu i nadmiernych uprawnień.

Oryginalny opis (EN)

Use when threat-modeling or hardening a Spring AI RAG, chat, or tool-calling workflow against prompt injection, unauthorized actions, data exposure, or unbounded execution. Ordinary model-provider integration alone does not require this review.

Jak działa

  1. Version boundary
  2. Establish the trust boundary
  3. Tool example and verification
  4. Review output
  5. Gotchas
  6. Official sources
Sekcje z nagłówków SKILL.md, w oryginale · 76 linii, 658 słów
Podgląd SKILL.md
---
name: spring-ai-security
description: >
  Use when threat-modeling or hardening a Spring AI RAG, chat, or tool-calling workflow
  against prompt injection, unauthorized actions, data exposure, or unbounded execution.
  Ordinary model-provider integration alone does not require this review.
---

# Spring AI Security

## Version boundary

Target Spring Boot 4 and the project's compatible Spring AI 2.x line. Preserve the repository's managed coordinates and provider choices.
The Java 17 tool boundary here is deliberately independent of Spring AI APIs. Wire it into
the selected version's tool mechanism and verify that adapter separately.

## Establish the trust boundary

Map user input, uploaded documents, retrieved chunks, memory, tool output and rendered
model responses. All can contain attacker-controlled content. A prompt instruction such as
"ignore malicious text", a delimiter, classifier or keyword denylist is not an authorization
boundary. Record what the model can read and which effects its tools can cause.

- Derive caller and tenant from verified server-side identity, not prompts, model arguments
  or an arbitrary client header. Scope retrieval in the storage query and recheck authorization
  before returning documents; output-only filtering is too late.
- Enforce the same ACLs during ingestion, vector retrieval, document lookup and cache/memory
  reuse. Bind conversation IDs to caller/tenant authorization; randomness alone is insufficient.
- Expose narrowly typed tools, not shell execution, raw SQL, arbitrary URLs or general admin APIs.
  Validate arguments and enforce permissions in application code immediately before effects.
- Require a trusted approval flow for sensitive writes: bind approval to actor, tenant, exact
  normalized action/arguments, expiry and one-time use. Reauthorize on execution. A model-supplied
  approved=true field or stale approval after argument changes is not consent.
- Bound tool calls, model iterations, response size, retrieval size, deadlines and per-user spend.
  Carry the same budget through retries and nested calls; a new tool instance must not reset a
  request's limit. Apply network/DB timeouts and cancellation independently of call counts.
- Restrict outbound destinations and data sent to providers. Do not send credentials or
  unnecessary private content. Treat returned HTML/Markdown/URLs as untrusted when rendering.
- Audit decisions and identifiers without recording full prompts, documents, tokens or secrets.

## Tool example and verification

[DocumentReadTool](templates/DocumentReadTool.java) accepts only a document UUID.
Its caller identity is server-supplied and immutable, permissions are checked in code,
and a server-owned CallBudget is shared across every tool instance for that authenticated turn.
All invocation attempts consume it, including denied or malformed calls. Do not create a new
budget on retry or share a caller/tool singleton across users. Never expose constructors,
caller identity or budgets as tool input. The reader must enforce tenant AND account access
in its storage query. For summarizing a preselected upload, prefer no tool at all when a
server-authorized document load is sufficient.

The example is read-only. It does not implement approval for writes, a Spring AI adapter,
vector-store ACLs, model-output sanitization or network timeouts. Its result-size check runs
after loading the body: also bound storage reads/streaming and total bytes in the adapter.
The fixture tests identity
scoping, invalid arguments, missing permission, exhausted budgets and oversized results without
calling a model. It is not a measured prompt-injection detection benchmark.

Use [the good scenario](examples/good-boundary.md) and [the bad scenario](examples/bad-boundary.md)
to plan tests involving hostile retrieved text, cross-user conversation IDs, cross-tenant
documents, repeated tool calls and legitimate text containing words such as "delete".
Assert the unauthorized effect never occurs; model refusal text alone is not a pass.

## Review output

List the trust boundaries, allowed effects, demonstrated controls and remaining gaps.
Label each claim **confirmed**, **suspected**, or **not verified**; distinguish deterministic
policy tests from provider/model evaluations. Preserve redacted evidence and test versions.
Request approval before sending private fixtures to a model provider or testing live tools.

## Gotchas

- Agent trusts a system prompt to enforce permissions - authorize every tool call in application code.
- Agent lets the model choose a tenant ID - derive scope from the authenticated server context.
- Agent resets budgets on retries - share the request budget and bound nested tool execution.
- Agent calls a filtered response proof of safety - assert that forbidden effects never happened.

## Official sources

- [Spring AI tool calling](https://docs.spring.io/spring-ai/reference/api/tools.html)
- [OWASP prompt injection prevention](https://cheatsheetseries.owasp.org/cheatsheets/LLM_Prompt_Injection_Prevention_Cheat_Sheet.html)
- [OWASP AI agent security](https://cheatsheetseries.owasp.org/cheatsheets/AI_Agent_Security_Cheat_Sheet.html)
Pliki w paczce (5)
  • SKILL.md 5 KB
  • agents/openai.yaml 1 KB
  • examples/bad-boundary.md 1 KB
  • examples/good-boundary.md 1 KB
  • templates/DocumentReadTool.java 3 KB

Wersje

RepozytoriumWynikLicencja
Ta strona · rrezartprebreza/spring-boot-skills100MIT
rrezartprebreza/spring-boot-skills100MIT

Migawka bazy z 13.11.2026 · wersja paczki 559242d58c39 (skrót SHA-256 całej paczki)

Pobrania w ostatnich 30 dniach: 0 · ranking

Zgłoś problem z tym skillem: szkodliwa treść, błędny opis albo prośba autora o usunięcie.

Podobne skille

  • 100spring-security-review
    Przegląda własną aplikację Spring Boot pod kątem autoryzacji, obsługi żądań i odsłoniętych endpointów zarządzania.
  • 100spring-boot-security
    Konfiguruje Spring Security 6+ z Lambda DSL, JWT i regułami hardeningu, także dla OAuth2.
  • 90skill-security-auditor
    Sprawdza skille, prompty i skrypty pod kątem wstrzyknięć promptu, wycieków sekretów, niebezpiecznych poleceń i nadmiernych uprawnień.
  • 100spring-security-review
    Sprawdza autoryzację, obsługę żądań i odsłonięte endpointy zarządzania w aplikacji Spring Boot i proponuje utwardzenie.
  • 100security-agent-guard
    Przegląda kod z LLM i agentami pod kątem iniekcji promptów, nadmiernych uprawnień i wycieków w RAG, wskazując plik i linię.
  • 96security-review
    Przegląda kod i zmiany pod kątem podatności: wstrzyknięć, sekretów, niebezpiecznego wejścia i uprawnień.

Uwagi i zgłoszenia

Wiadomość trafi do Bartosza Sokolińskiego. Adres e-mail jest potrzebny tylko do odpowiedzi. Szczegóły w polityce prywatności.