Logo Autonomous Loops

Autonomous Loops

Cộng đồng
brucesongs
autonomous-loops

Performing repetitive enumeration across many targets - Running batch vulnerability scans on multiple hosts - Monitoring for changes in target environment - Executing attack chains that require iterative steps - User says "loop", "automate", "batch", "repeat.

Add to TypingMind

Tổng quan

Nhà phát hànhbrucesongs
Kho mãkali-claw
Tên kỹ năngautonomous-loops
Sao
70
Bản fork
18
Tệp đi kèm
17
Giấy phépMIT
Liên kết
  • Hướng dẫn bằng Markdown

    Tệp SKILL.md được mô hình tải khi cần, nên chỉ tốn token khi có yêu cầu thực sự phù hợp.

  • Dùng được với mọi LLM

    Kỹ năng AI dùng hướng dẫn viết bằng Markdown thay vì mã dành riêng cho một nhà cung cấp, nên dùng được với GPT, Claude, Gemini, Grok hoặc mô hình cục bộ.

  • 17 tệp đi kèm

    Các tập lệnh, mẫu và tài liệu tham khảo mà mô hình có thể đọc khi làm việc. Các tệp chỉ cho phép đọc và không bao giờ được thực thi.

  • Mã nguồn mở

    Được brucesongs công bố trên GitHub. Hãy đọc các tệp nguồn trước khi cài đặt.

Cài đặt

Cài đặt kỹ năng AI Autonomous Loops trong TypingMind để dùng với bất kỳ LLM nào, hoặc thêm vào một tác nhân AI khác có thể đọc SKILL.md.

1

Cài đặt trong TypingMind

TypingMind cài đặt kỹ năng trực tiếp từ thư mục GitHub — đọc SKILL.md, đóng gói các tệp tài nguyên và lưu kết quả trên máy.

  1. Mở ứng dụng và vào Plugin → Kỹ năng.
  2. Chọn "Cài đặt từ GitHub".
  3. Dán URL của thư mục kỹ năng được hiển thị bên dưới rồi xác nhận.
    https://github.com/brucesongs/kali-claw/tree/main/skills/autonomous-loops
  4. Bật kỹ năng trong từng cuộc trò chuyện mà bạn muốn sử dụng kỹ năng đó.
Plugin → Kỹ năng → Thêm kỹ năng → Từ URL GitHub, sau đó dán URL thư mục và nhấn Tiếp tục.
2

Cài đặt trong tác nhân AI khác

Bất kỳ tác nhân AI nào đọc được định dạng Agent Skills đều có thể dùng kỹ năng này — hãy sao chép thư mục vào thư mục kỹ năng của tác nhân AI đó.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/brucesongs/kali-claw.git /tmp/kali-claw
mkdir -p .claude/skills
cp -r /tmp/kali-claw/skills/autonomous-loops .claude/skills/autonomous-loops
Khởi động lại Claude Code sau khi sao chép để ứng dụng nhận kỹ năng mới.

Sử dụng trong TypingMind

Bật Autonomous Loops trong bất kỳ cuộc trò chuyện nào trên TypingMind, mô hình sẽ tự xử lý phần còn lại. Tên và mô tả của kỹ năng nằm trong prompt hệ thống. Ngay khi có yêu cầu phù hợp, mô hình tự tải toàn bộ hướng dẫn — bạn không cần gọi thủ công và kỹ năng không tốn token cho đến khi thực sự được dùng.

Mô hình tự nạp Autonomous Loops ngay khi có yêu cầu phù hợp.

Dùng được với mọi mô hình AI

Kỹ năng AI là các hướng dẫn Markdown thuần túy, không phải mã dành riêng cho một nhà cung cấp, nên bạn có thể dùng Autonomous Loops với cả những mô hình khác ngoài mô hình ban đầu. Chỉ cần cài đặt một lần trong TypingMind rồi dùng với GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama hoặc mô hình cục bộ do bạn tự chạy — tất cả đều dùng khóa API của riêng bạn.

  • Chỉ tải khi cần

    Prompt hệ thống chỉ chứa tên và mô tả. Hướng dẫn được tải khi có yêu cầu phù hợp đầu tiên, nên khi kỹ năng chưa được dùng, bạn không tốn token cho phần hướng dẫn.

  • Đổi mô hình ngay trong cuộc trò chuyện

    Vì kỹ năng là hướng dẫn chứ không phải mã, việc đổi mô hình không làm kỹ năng ngừng hoạt động — mô hình tiếp theo vẫn đọc cùng tệp SKILL.md.

Hướng dẫn của kỹ năng

Đây là nội dung SKILL.md mà mô hình tải. Hãy đọc trước khi cài đặt — kỹ năng là những hướng dẫn mà mô hình của bạn sẽ làm theo.

Autonomous Loops

Supplementary Files:

  • payloads.md — Scope Lock templates, rate limit configurations, loop command templates, and error handling response templates
  • test-cases.md — Structured test cases for sequential pipeline, watch loop, batch processing, learning cycle, scope violation, and rate limit backoff
  • guides/safe-autonomous-pentest.md — Deep-dive guide on autonomous vs manual decision making, scope lock construction, loop composition, and monitoring

Summary

Autonomous Loops skill domain covering infrastructure operations.

Domain: infrastructure

Use Cases

  1. Sequential Pipeline — Chain multiple security tools in order (recon → scan → exploit) with automatic phase transitions
  2. Watch Loop — Monitor a target for changes (new ports, updated services) over extended periods
  3. Batch Processing — Run the same test against multiple targets with rate limiting and error recovery
  4. Learning Cycle — Execute a skill, capture results, extract patterns, and update knowledge base automatically
  5. Scope-Locked Automation — Run autonomous loops with hard boundaries that prevent actions outside authorized scope

Activation

  • Performing repetitive enumeration across many targets
  • Running batch vulnerability scans on multiple hosts
  • Monitoring for changes in target environment
  • Executing attack chains that require iterative steps
  • User says "loop", "automate", "batch", "repeat", "iterate"

Core Principle

Autonomous does not mean uncontrolled. Every loop must have:

  1. A defined scope (what it can and cannot touch)
  2. A termination condition (when it stops)
  3. Rate limiting (how fast it runs)
  4. Evidence logging (what it did)
  5. Error handling (what happens when things go wrong)

Four Loop Patterns

Pattern 1: Sequential Pipeline

Execute a sequence of steps across multiple targets, one at a time.

FOR EACH target IN target_list:
    IF scope_check(target) == ALLOWED:
        result = execute_step(target)
        log_evidence(target, result)
        IF result.status == FAIL:
            handle_error(target, result)
            CONTINUE or BREAK based on severity
    ELSE:
        log_skipped(target, "Out of scope")

Use when: Enumerating ports across a subnet, testing a specific vulnerability across multiple hosts.

Safety rules:

  • Process targets sequentially (no parallel burst)
  • Log every target attempted and result
  • Stop on critical error (target down, IDS triggered)
  • Maximum 100 targets per pipeline run

Pattern 2: Watch Loop

Monitor a target for changes or conditions, then act when triggered.

WHILE condition_not_met AND iterations < max_iterations:
    current_state = observe(target)
    log_observation(current_state)
    IF trigger_condition(current_state):
        result = execute_response(target, current_state)
        log_evidence("trigger", result)
        IF one_shot: BREAK
    WAIT(polling_interval)

Use when: Waiting for a service to come online, monitoring for new open ports, watching log files for specific events.

Safety rules:

  • Polling interval minimum: 5 seconds
  • Maximum iterations: 1000
  • Log every observation cycle
  • Alert when approaching iteration limit

Pattern 3: Batch Processing

Apply the same operation to a batch of targets in parallel (with concurrency limit).

CONCURRENCY = 5  # Maximum simultaneous operations
results = []

FOR EACH batch IN split_into_batches(target_list, CONCURRENCY):
    batch_results = PARALLEL execute_step(batch)
    FOR EACH result IN batch_results:
        log_evidence(result.target, result)
        results.append(result)
    WAIT(rate_limit_delay)  # Pause between batches

Use when: Running nmap scans across many hosts, batch DNS lookups, mass HTTP header checks.

Safety rules:

  • Maximum concurrency: 10
  • Rate limit delay between batches: 2 seconds minimum
  • Log all results including failures
  • Respect target-specific rate limits if known

Pattern 4: Learning Cycle

Iteratively refine an approach based on results from previous iterations.

approach = initial_approach
FOR iteration IN range(max_iterations):
    result = execute(approach)
    analysis = analyze_result(result)
    log_evidence(iteration, approach, result, analysis)
    IF analysis.success:
        log_evidence("success", approach)
        BREAK
    approach = refine(approach, analysis)
    IF approach.confidence < min_confidence:
        log_evidence("abort", "Confidence below threshold")
        BREAK

Use when: Brute-forcing with adaptive wordlists, SQL injection payload refinement, fuzzing with feedback.

Safety rules:

  • Maximum iterations: 50
  • Log every attempt and result
  • Confidence threshold: abort if below 10% after 10 attempts
  • Never widen scope during refinement

Safety Framework

Scope Lock

Before ANY loop starts, define and lock the scope:

markdown
## Scope Lock: [Operation Name]
- **Allowed targets:** [CIDR range / hostname list / URL list]
- **Allowed operations:** [Specific commands/techniques]
- **Forbidden operations:** [What must NOT be done]
- **Time limit:** [Maximum wall-clock time]
- **Iteration limit:** [Maximum number of iterations]
- **Abort conditions:** [Specific triggers that stop the loop]

Once defined, the scope cannot be widened during execution.

Rate Limiting

Operation TypeMinimum IntervalMax Concurrency
Network scan (nmap)2s between hosts5
Web request (HTTP)100ms between requests3
DNS lookup50ms between queries10
Brute force attempt500ms between attempts1
Exploit attempt5s between attempts1

Evidence Logging

Every loop iteration must log:

markdown
## Loop Log Entry
- **Timestamp:** [ISO 8601]
- **Iteration:** [N / max]
- **Target:** [host/port/URL]
- **Action:** [command or technique]
- **Result:** [success/fail/error/timeout]
- **Output:** [truncated to 500 chars, full output saved to file]
- **State change:** [what changed on target, if any]

Error Handling

Error TypeResponse
Target unreachableLog and skip, continue to next target
Rate limit detectedIncrease delay by 2x, retry once
Authentication failureLog and skip (do NOT retry with variations)
Unexpected service responseLog details, flag for manual review, continue
IDS/IPS detectedSTOP immediately, log incident
Target crash/unexpected downtimeSTOP immediately, log incident
Scope violation attemptSTOP immediately, log incident

Notification Rules

Notify the operator when:

  • Loop starts (with scope summary)
  • Every 25 iterations or 5 minutes (whichever comes first)
  • Any error condition occurs
  • Loop completes or aborts

Integration with Other Skills

SkillLoop PatternApplication
vulnerability-assessmentBatch ProcessingScan multiple hosts for vulnerabilities
password-attackLearning CycleAdaptive brute force with feedback
web-sqliLearning CycleIterative payload refinement
network-pentestSequential PipelineMulti-host enumeration
osintBatch ProcessingMass DNS/WHOIS lookups
terminal-opsAll patternsEvidence logging protocol
verification-loopSequential PipelineVerify findings across multiple hosts
safety-guardAll patternsPre-execution safety checks

Detection Methods

Autonomous Loop Indicators

  • Sustained agent activity: Same agent token executing >100 sequential operations; >24h continuous runtime.
  • Tool call cadence: Constant-interval tool calls (e.g., every 30s exactly); typical of cron-driven loops.
  • State persistence: Agent re-loading state from previous session; checkpoint file access patterns.
  • Memory growth: Agent process accumulating >2GB RAM; typical of long-running loops without state cleanup.
  • Self-modifying prompts: Agent modifying its own system prompt or configuration mid-run.

SIEM Detection Rules

  • Splunk SPL: index=llm gateway.user="agent-*" | stats range(_time) as duration by session_id | where duration > 86400
  • Sigma rule: sigma/rules/ai/long_running_agent.yml
  • LangSmith trace analysis: Detect agents with >1000 turns in single session.

Defense Evasion Techniques

Loop Stealth

  • Off-hours operation: Run loops during low-traffic hours; blends with maintenance tasks.
  • Distributed sessions: Cycle through multiple agent sessions to avoid per-session limits.
  • Memory cleanup between cycles: Clear conversation history to reduce token usage anomaly.
  • Slow pacing: Pace tool calls at irregular intervals to avoid cadence detection.
  • State externalization: Store state in external KV store rather than session memory.

Self-Modification Stealth

  • Gradual config changes: Modify system prompt in small increments over multiple sessions.
  • Use environment variables: Modify env vars rather than prompts (less audited).
  • Persistence via legitimate mechanisms: Use MCP server registration (looks legitimate).

Anti-Patterns

  • Infinite loops — Every loop MUST have a termination condition
  • Scope creep — Never add targets during execution
  • Silent failures — Every error must be logged and reported
  • Unbounded parallelism — Always set and respect concurrency limits
  • Skipping evidence — Even failed attempts must be logged
  • Ignoring rate limits — Target stability is more important than speed

Orchestration

ECC Loop Pattern

  • Pattern: Meta-Skill (defines loop patterns consumed by all other skills)
  • Rationale: Autonomous loops is not an end-user skill but a meta-skill that provides loop constructs for all other security skills — every skill that needs iterative or batch operations consumes one of the four loop patterns
  • Integration: All security skills that need repetitive operations consume loop patterns from this skill. Each skill selects the appropriate pattern based on its workflow needs.

Cross-Skill Pipeline

autonomous-loops (provides loop patterns)
    ├── Sequential Pipeline → network-pentest, terminal-ops, verification-loop
    ├── Watch Loop → security-bounty-hunter, deep-research
    ├── Batch Processing → repo-scan, osint, vulnerability-assessment
    └── Learning Cycle → search-first, continuous-learning, password-attack

Quality Gate

  • Pre-condition: Scope Lock defined with allowed targets, operations, and abort conditions
  • Post-condition: Evidence chain complete for every iteration, all results logged
  • Verification: Scope not widened during execution, iteration/iteration limits respected, rate limits maintained

Tệp đi kèm

Khi kỹ năng đã được tải, mô hình có thể đọc các tệp này nếu cần. Các tệp này chỉ dùng để đọc và không bao giờ được thực thi.

Câu hỏi thường gặp

Kỹ năng AI Autonomous Loops làm được gì?

Performing repetitive enumeration across many targets - Running batch vulnerability scans on multiple hosts - Monitoring for changes in target environment - Executing attack chains that require iterative steps - User says "loop", "automate", "batch", "repeat.

Vì sao nên dùng Autonomous Loops trên TypingMind?

Vì bạn chỉ cần cài một lần rồi dùng với bất kỳ mô hình nào. Autonomous Loops là nội dung Markdown chứ không phải mã dành riêng cho từng nhà cung cấp, nên cùng một kỹ năng có thể chạy trên GPT-5, Claude, Gemini, Grok hoặc mô hình trên thiết bị — và bạn có thể đổi mô hình ngay trong cuộc trò chuyện mà kỹ năng vẫn hoạt động. TypingMind dùng khóa API riêng của bạn, nên bạn thanh toán trực tiếp cho nhà cung cấp thay vì trả phí thuê bao theo suất người dùng, đồng thời kỹ năng và các cuộc trò chuyện vẫn nằm trong bộ lưu trữ của bạn.

Làm thế nào để cài Autonomous Loops trong TypingMind?

Mở Plugin → Kỹ năng → Cài đặt từ GitHub trong TypingMind rồi dán https://github.com/brucesongs/kali-claw/tree/main/skills/autonomous-loops. TypingMind đọc tệp SKILL.md, đóng gói các tệp đi kèm rồi cài đặt cả gói dưới dạng một kỹ năng mà bạn có thể bật cho từng cuộc trò chuyện.

Những mô hình AI nào có thể dùng Autonomous Loops?

Bất kỳ mô hình nào bạn kết nối trong TypingMind. Kỹ năng AI là các hướng dẫn bằng Markdown chứ không phải mã dành riêng cho từng nhà cung cấp, nên GPT, Claude, Gemini, Grok và các mô hình chạy trên thiết bị đều có thể tải kỹ năng này khi có yêu cầu phù hợp.

Có thể dùng Autonomous Loops với bao nhiêu mô hình AI?

Bao nhiêu cũng được. Miễn là mô hình hỗ trợ kỹ năng, bạn có thể dùng Autonomous Loops với mô hình đó — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama và nhiều mô hình khác — tất cả đều trên TypingMind với khóa API riêng của bạn.

Kỹ năng AI Autonomous Loops có miễn phí không?

Có. Kỹ năng này được brucesongs phát hành trên GitHub theo giấy phép MIT. Bạn chỉ trả tiền cho nhà cung cấp AI của mình theo số token đã dùng.

Kỹ năng AI là gì?

Kỹ năng AI là một gói hướng dẫn có thể tái sử dụng, chỉ cho mô hình AI cách thực hiện một tác vụ cụ thể. Kỹ năng tuân theo định dạng mở Agent Skills: một tệp SKILL.md chứa tên và mô tả, cùng các tập lệnh, mẫu hoặc tệp tham khảo mà mô hình có thể cần. Mô hình chỉ đọc hướng dẫn khi yêu cầu của bạn phù hợp với kỹ năng, nên kỹ năng đã cài đặt không phát sinh chi phí cho đến khi được sử dụng.

Kỹ năng AI khác gì với plugin hoặc máy chủ MCP?

Plugin hoặc máy chủ MCP cung cấp các công cụ mới mà mô hình có thể gọi. Khi mô hình gọi một công cụ, mã của công cụ đó chạy ở đâu đó và trả về kết quả. Còn kỹ năng AI cung cấp kiến thức và quy trình: cách tiếp cận tác vụ, các bước cần thực hiện và những tiêu chí mà kết quả cần đáp ứng. Kỹ năng chỉ là nội dung Markdown, nên không cần máy chủ, khóa API hay môi trường thực thi và hoạt động với mọi mô hình.

Xem tất cả

Tạo ngay không gian làm việc AI riêng

Đăng ký bản tin của chúng tôi để nhận thông báo về tính năng mới và các đợt tặng quà sắp tới 👇