Skip to content

feat: Add autonomous-enterprise-audit-sanctions-compliance template - #323

Open
maitimeraki wants to merge 4 commits into
Lamatic:mainfrom
maitimeraki:main
Open

feat: Add autonomous-enterprise-audit-sanctions-compliance template#323
maitimeraki wants to merge 4 commits into
Lamatic:mainfrom
maitimeraki:main

Conversation

@maitimeraki

@maitimeraki maitimeraki commented Aug 5, 2026

Copy link
Copy Markdown

Problem

An AI-powered compliance workflow for onboarding high-profile corporate clients and vendors. This kit screens entities against sanctions and risk signals, extracts and verifies onboarding documents, audits public financial and compliance records, and stores a durable memory trail of the checks that were performed. High-risk cases are escalated to human compliance managers with Slack and external verification support.

What this kit does

Send a vendor onboarding packet, audit document, or compliance checklist to the webhook and get back an automated compliance decision that can:

  • Screen the entity using document extraction, classifier routing, and retrieval against prior audit memory
  • Search internal compliance knowledge using hybrid search over stored vectors and indexed records
  • Verify onboarding details through an external API check before final classification
  • Escalate suspicious, incomplete, or high-risk cases to a supervisor path with MCP-assisted investigation
  • Record approved low-risk audits in immutable memory and vector storage for future lookup
  • Notify compliance operators in Slack when manual review is required
  • Return a structured JSON summary with vendor name, document title, risk level, audit status, and decision summary

Flow Architecture

Webhook
	↓
Extract from File
	↓
Agentic Doc Extraction
	↓
Classifier
	├── Memory Retrieve
	├── Hybrid Search
	└── API
	↓
Supervisor
	├── MCP
	└── Slack
	↓
Generate JSON
	↓
Vectorize
	↓
VectorDB
	↓
Memory Add
	↓
End

Configuration

Setting Purpose
Trigger Webhook upload or document URL
OCR Document parsing and field extraction
Classifier Routes the audit into memory, search, or API verification paths
External API Compliance and onboarding verification
Supervisor Final routing for low-risk or high-risk decisions
Slack Manual review and escalation alerts
Vector DB Indexed audit history and retrieval support
Memory Persistent audit log and future lookup context

Checklist

  • Folder at kits/autonomous-enterprise-audit-sanctions-compliance/ (kebab-case, unique)
  • lamatic.config.ts with valid type, name, author, tags, steps, links
  • agent.md present
  • README.md present
  • flows/autonomous-enterprise-audit-sanctions-compliance.ts exists for the declared step
  • constitutions/default.md present
  • links.github points to kits/autonomous-enterprise-audit-sanctions-compliance
  • PR touches only files inside kits/autonomous-enterprise-audit-sanctions-compliance/
  • Added the autonomous-enterprise-audit-sanctions-compliance kit.
  • Added setup and usage documentation in README.md and agent.md.
  • Added the default constitution with identity, safety, data-handling, and communication rules.
  • Added Lamatic metadata, tags, mandatory workflow configuration, and GitHub link.
  • Added ignore rules for .lamatic/, node_modules/, .env, and .env.local.
  • Added Mistral model configurations for agent, classifier, memory, retrieval, hybrid search, vectorization, instructor, and MCP nodes.
  • Added prompts for document extraction, OCR cleanup, document classification, risk supervision, routing, and low-risk audit formatting.
  • Added the complete workflow definition with:
    • Webhook intake.
    • Document extraction and structured compliance analysis.
    • Document classification and conditional routing.
    • Memory retrieval and hybrid search.
    • External API verification.
    • Supervisor-based risk evaluation.
    • Low-risk formatting, vectorization, and persistent memory storage.
    • High-risk MCP verification and Slack escalation.
    • Conditional and loop-based routing.

@coderabbitai

coderabbitai Bot commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Important

Review skipped

No new commits to review since the last review.

⚙️ Run configuration

Configuration used: Repository UI (base), Organization UI (inherited)

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 96d878df-4745-40c9-a7dc-05d18b3a0b96

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Walkthrough

Changes

Enterprise audit and sanctions compliance workflow

Layer / File(s) Summary
Workflow foundation and runtime configuration
kits/autonomous-enterprise-audit-sanctions-compliance/flows/..., constitutions/default.md, lamatic.config.ts, model-configs/*
Defines workflow metadata, credentials, model assignments, constitution rules, and template configuration.
Document intake and evidence routing
kits/autonomous-enterprise-audit-sanctions-compliance/flows/..., prompts/*classifier*, prompts/*doc-extraction*
Processes PDF input with OCR, extracts structured audit data, classifies documents, and routes evidence to retrieval or compliance API nodes.
Risk handling, output, and persistence
kits/autonomous-enterprise-audit-sanctions-compliance/flows/..., prompts/*agent-node*, prompts/*instructor*
Evaluates risk, formats low-risk results, persists audit data, and sends high-risk cases through MCP verification and Slack escalation.
Operational documentation and repository setup
kits/autonomous-enterprise-audit-sanctions-compliance/README.md, agent.md, .gitignore
Documents setup, operation, integrations, troubleshooting, example flows, and ignored local files.

Suggested reviewers: amanintech, d-pamneja

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title clearly and concisely identifies the addition of the autonomous enterprise audit sanctions compliance template.
Description check ✅ Passed The description clearly explains the workflow, architecture, configuration, scope, and required files.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions

github-actions Bot commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

:robot_face: AgentKit Structural Validation

New Contributions Detected

  • Template: kits/autonomous-enterprise-audit-sanctions-compliance

Check Results

Check Status
No edits to existing kits ✅ Pass
Required root files present ✅ Pass
Flow .ts files present ✅ Pass
lamatic.config.ts valid ✅ Pass
No changes outside kits/ ✅ Pass

🎉 All checks passed! This contribution follows the AgentKit structure.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 13

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In
`@kits/autonomous-enterprise-audit-sanctions-compliance/flows/autonomous-enterprise-audit-sanctions-compliance.ts`:
- Around line 505-507: Update the Vectorize node’s inputText and metadataField
construction to insert clear separators between vendor_name, document_title, and
summary, preserving the existing field order and values while preventing
boundary tokens from merging.
- Around line 229-239: Move the inline ocrModelName configuration into
model-configs/autonomous-enterprise-audit-sanctions-compliance_agentic-doc-extraction-node-581_ocr-model-name.ts,
preserving its provider, model, credential, and config values. Remove the inline
block from the flow and update references.modelConfigs to point to the external
`@model-configs` configuration, matching the existing model selection pattern.
- Around line 171-202: Remove the unused dynamic node identified by id
extractFromFileNode_877, since no downstream node consumes its output and
agenticDocExtractionNode_581 reads triggerNode_1.output.prompt directly.
Alternatively, update agenticDocExtractionNode_581 to consume
extractFromFileNode_877.output and preserve the extraction flow, but do not
leave the node disconnected.
- Around line 350-353: Document the Middesk integration requirements in the kit
README: use the production businesses endpoint instead of the sandbox host and
configure the required Authorization credential alongside Content-Type.
Alternatively, update the request configuration around the POST businesses call
to reference the established credential mechanism, ensuring adopters do not send
unauthenticated requests.
- Around line 550-555: Update the memoryValue content in the audit memory record
to use the Agentic Doc Extraction node’s ID-based interpolation, matching the
existing agenticDocExtractionNode_581.output.structuredData path used elsewhere
in the flow, for both vendor_name and document_title references; preserve the
$now interpolation and surrounding message.
- Line 435: The promptTemplate in the escalation evaluation node must
interpolate the vendor name instead of leaving an empty placeholder. Restore the
vendor-name expression used by the surrounding flow before “and verify
compliance records,” while preserving the existing
agenticDocExtractionNode_581.output.extractedText interpolation.
- Around line 726-733: Delete the edge with id
xy-edge__vectorizeNode_704bottom-InstructorLLMNode_771top from the flow
definition, leaving the existing InstructorLLMNode_771 → vectorizeNode_704
connection and declared agent-loop edges unchanged.
- Around line 452-459: Update the terminal Slack node identified by id
"slackNode_425" and nodeName "Slack" to post a high-risk sanctions escalation
alert instead of the generic greeting. Build the message from the flagged
vendor/entity, risk finding, and MCP verification result available in the
HighRiskAgent flow, and replace the placeholder channelName "C0BMENFFABC" with
the configured escalation channel identifier.
- Around line 4-16: Update the exported meta object in the autonomous enterprise
audit sanctions compliance flow by populating description, tags, and githubUrl
from the corresponding values in lamatic.config.ts, and provide the appropriate
deployUrl. Preserve the existing name, author, and other metadata fields while
ensuring template listings no longer show these fields as empty.
- Around line 273-289: Update the three classifier value entries in the
classifier configuration to reference the declared agentClassifierEdge IDs: map
Memory Retrieve to agentClassifierNode_252-memoryRetrieveNode_264-651, API to
agentClassifierNode_252-apiNode_483-112, and Hybrid Search to
agentClassifierNode_252-hybridSearchNode_546-234, while preserving their labels
and descriptions.
- Line 351: The request body template currently serializes the non-string fields
incorrectly. In the payload body near agenticDocExtractionNode_581, remove JSON
string quotes around has_all_signoffs and compliance_checklist so they remain
boolean and array values; keep quotes around vendor_name, document_title, and
extracted_text.

In
`@kits/autonomous-enterprise-audit-sanctions-compliance/prompts/autonomous-enterprise-audit-sanctions-compliance_agent-classifier-node-252_user_1.md`:
- Around line 1-5: Update the classifier prompt text to begin with “Analyze the
following document...” instead of the malformed “WriAnalyze”, and remove the
trailing “te your prompt here” fragment so the prompt ends immediately after
{{agenticDocExtractionNode_581.output.extractedText}}.

In
`@kits/autonomous-enterprise-audit-sanctions-compliance/prompts/autonomous-enterprise-audit-sanctions-compliance_instructor-llmnode-771_user_1.md`:
- Around line 2-4: Update the Vendor Details mappings to inject the exact
vendor_name and document_title fields from agenticDocExtractionNode_581’s
structuredData using the precise paths already used elsewhere in the flow; do
not pass the entire structuredData object or extractedText dump, and preserve
the existing labels so the schema values remain suitable for the VectorDB
primary key and Memory uniqueId.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI (base), Organization UI (inherited)

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 1c8b1e35-2944-4602-a768-724f4109ee0e

📥 Commits

Reviewing files that changed from the base of the PR and between 3e355f5 and ca2bd98.

📒 Files selected for processing (22)
  • kits/autonomous-enterprise-audit-sanctions-compliance/.gitignore
  • kits/autonomous-enterprise-audit-sanctions-compliance/README.md
  • kits/autonomous-enterprise-audit-sanctions-compliance/agent.md
  • kits/autonomous-enterprise-audit-sanctions-compliance/constitutions/default.md
  • kits/autonomous-enterprise-audit-sanctions-compliance/flows/autonomous-enterprise-audit-sanctions-compliance.ts
  • kits/autonomous-enterprise-audit-sanctions-compliance/lamatic.config.ts
  • kits/autonomous-enterprise-audit-sanctions-compliance/model-configs/autonomous-enterprise-audit-sanctions-compliance_agent-classifier-node-252_generative-model-name.ts
  • kits/autonomous-enterprise-audit-sanctions-compliance/model-configs/autonomous-enterprise-audit-sanctions-compliance_agent-node-143_generative-model-name.ts
  • kits/autonomous-enterprise-audit-sanctions-compliance/model-configs/autonomous-enterprise-audit-sanctions-compliance_hybrid-search-node-546_embedding-model-name.ts
  • kits/autonomous-enterprise-audit-sanctions-compliance/model-configs/autonomous-enterprise-audit-sanctions-compliance_instructor-llmnode-771_generative-model-name.ts
  • kits/autonomous-enterprise-audit-sanctions-compliance/model-configs/autonomous-enterprise-audit-sanctions-compliance_mcp-node-737_generative-model-name.ts
  • kits/autonomous-enterprise-audit-sanctions-compliance/model-configs/autonomous-enterprise-audit-sanctions-compliance_memory-node-421_embedding-model-name.ts
  • kits/autonomous-enterprise-audit-sanctions-compliance/model-configs/autonomous-enterprise-audit-sanctions-compliance_memory-node-421_generative-model-name.ts
  • kits/autonomous-enterprise-audit-sanctions-compliance/model-configs/autonomous-enterprise-audit-sanctions-compliance_memory-retrieve-node-264_embedding-model-name.ts
  • kits/autonomous-enterprise-audit-sanctions-compliance/model-configs/autonomous-enterprise-audit-sanctions-compliance_vectorize-node-704_embedding-model-name.ts
  • kits/autonomous-enterprise-audit-sanctions-compliance/prompts/autonomous-enterprise-audit-sanctions-compliance_agent-classifier-node-252_system_0.md
  • kits/autonomous-enterprise-audit-sanctions-compliance/prompts/autonomous-enterprise-audit-sanctions-compliance_agent-classifier-node-252_user_1.md
  • kits/autonomous-enterprise-audit-sanctions-compliance/prompts/autonomous-enterprise-audit-sanctions-compliance_agent-node-143_system_0.md
  • kits/autonomous-enterprise-audit-sanctions-compliance/prompts/autonomous-enterprise-audit-sanctions-compliance_agent-node-143_user_1.md
  • kits/autonomous-enterprise-audit-sanctions-compliance/prompts/autonomous-enterprise-audit-sanctions-compliance_agentic-doc-extraction-node-581_system_0.md
  • kits/autonomous-enterprise-audit-sanctions-compliance/prompts/autonomous-enterprise-audit-sanctions-compliance_instructor-llmnode-771_system_0.md
  • kits/autonomous-enterprise-audit-sanctions-compliance/prompts/autonomous-enterprise-audit-sanctions-compliance_instructor-llmnode-771_user_1.md

Comment on lines +350 to +353
"url": "https://api-sandbox.middesk.com/v1/businesses",
"body": "{\n \"vendor_name\": \"{{ agenticDocExtractionNode_581.output.structuredData.0.annotation.vendor_details.vendor_name || '' }}\",\n \"has_all_signoffs\": \"{{ agenticDocExtractionNode_581.output.structuredData.0.annotation.document_metadata.has_all_signoffs || false }}\",\n \"document_title\": \"{{ agenticDocExtractionNode_581.output.structuredData.0.annotation.document_metadata.document_title || '' }}\",\n \"compliance_checklist\": \"{{ agenticDocExtractionNode_581.output.structuredData.0.annotation.compliance_checklist || [] }}\",\n \"extracted_text\": \"{{ agenticDocExtractionNode_581.output.extractedText || '' }}\"\n}",
"method": "POST",
"headers": "{\"Content-Type\":\"application/json\"}",

@coderabbitai coderabbitai Bot Aug 5, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

The endpoint is a sandbox, and the request carries no credential. https://api-sandbox.middesk.com/v1/businesses is Middesk's test host, and headers contains only Content-Type. Adopters will get 401s or silent sandbox writes. Document the production host and the required Authorization header in the kit README, or wire a credential reference.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In
`@kits/autonomous-enterprise-audit-sanctions-compliance/flows/autonomous-enterprise-audit-sanctions-compliance.ts`
around lines 350 - 353, Document the Middesk integration requirements in the kit
README: use the production businesses endpoint instead of the sandbox host and
configure the required Authorization credential alongside Content-Type.
Alternatively, update the request configuration around the POST businesses call
to reference the established credential mechanism, ensuring adopters do not send
unauthenticated requests.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So basically this is demo url that is why it does not works.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@maitimeraki, acknowledged. The demo endpoint does not work, so the workflow cannot complete external verification as configured.

Mission status: the finding remains valid. Please either document this node as a non-functional demo in the README or replace it with a configurable endpoint and Authorization credential reference. This prevents adopters from expecting the template to work without changes.


✏️ Learnings added
Learnt from: maitimeraki
Repo: Lamatic/AgentKit PR: 323
File: kits/autonomous-enterprise-audit-sanctions-compliance/flows/autonomous-enterprise-audit-sanctions-compliance.ts:350-353
Timestamp: 2026-08-09T05:59:00.255Z
Learning: In `kits/autonomous-enterprise-audit-sanctions-compliance/flows/autonomous-enterprise-audit-sanctions-compliance.ts`, the Middesk sandbox URL in `apiNode_483` is intentionally a non-working demo endpoint. Review the kit documentation and integration configuration to ensure adopters are told that they must replace or configure this endpoint before use.

Note: Learnings are effective only in the context of similar code segments. To apply general coding guidelines, please configure review instructions. You can manage existing learnings in the app.

You are interacting with an AI system.

Comment on lines +726 to +733
{
"id": "xy-edge__vectorizeNode_704bottom-InstructorLLMNode_771top",
"source": "vectorizeNode_704",
"target": "InstructorLLMNode_771",
"sourceHandle": "bottom",
"targetHandle": "top",
"type": "defaultEdge"
},

@coderabbitai coderabbitai Bot Aug 5, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🩺 Stability & Availability | 🔴 Critical | ⚡ Quick win

Reverse edge creates a cycle. Line 695 already routes InstructorLLMNode_771vectorizeNode_704. This edge routes vectorizeNode_704InstructorLLMNode_771. The pair forms a loop outside the declared agent-loop edges, and vectorizeNode_704.inputText at Line 506 depends on InstructorLLMNode_771 output, so the reverse direction is unsatisfiable. Delete this edge.

🐛 Proposed fix
-  {
-    "id": "xy-edge__vectorizeNode_704bottom-InstructorLLMNode_771top",
-    "source": "vectorizeNode_704",
-    "target": "InstructorLLMNode_771",
-    "sourceHandle": "bottom",
-    "targetHandle": "top",
-    "type": "defaultEdge"
-  },
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
{
"id": "xy-edge__vectorizeNode_704bottom-InstructorLLMNode_771top",
"source": "vectorizeNode_704",
"target": "InstructorLLMNode_771",
"sourceHandle": "bottom",
"targetHandle": "top",
"type": "defaultEdge"
},
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In
`@kits/autonomous-enterprise-audit-sanctions-compliance/flows/autonomous-enterprise-audit-sanctions-compliance.ts`
around lines 726 - 733, Delete the edge with id
xy-edge__vectorizeNode_704bottom-InstructorLLMNode_771top from the flow
definition, leaving the existing InstructorLLMNode_771 → vectorizeNode_704
connection and declared agent-loop edges unchanged.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

keep as it is

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@maitimeraki, acknowledged. The edge will remain as is. The review finding remains open by design.

You are interacting with an AI system.

@github-actions

github-actions Bot commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Hi @maitimeraki! 👋

Before this PR can be reviewed by maintainers, please resolve all comments and requested changes from the CodeRabbit automated review.

Steps to follow:

  1. Read through all CodeRabbit comments carefully
  2. Address each issue raised (or reply explaining why you disagree)
  3. Push your fixes as new commits
  4. Once all issues are resolved, comment here so we can re-review

This helps keep the review process efficient for everyone. Thank you! 🙏

@akshatvirmani

Copy link
Copy Markdown
Contributor

/validate

@github-actions

github-actions Bot commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

📡 Running Studio validation — results will appear here shortly.

@github-actions

github-actions Bot commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Studio Runtime Validation (Phase 2)

Studio validation passed. The kit loaded successfully in Lamatic Studio.

This PR is ready for final review and merge.

@akshatvirmani

Copy link
Copy Markdown
Contributor

@maitimeraki PR LGTM!

There are some comments left by coderabbit, please solve them and we are ready to merge.

@maitimeraki

Copy link
Copy Markdown
Author

Just go through where your comment or input required, because when you go through the pull request, you find out that CodeRabbit actually needs the input from your site. So just do that.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 5

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (4)
kits/autonomous-enterprise-audit-sanctions-compliance/flows/autonomous-enterprise-audit-sanctions-compliance.ts (4)

18-25: ⚠️ Potential issue | 🟠 Major

Mission: wire ocrModelName to the runtime configuration.

The flow declares inputs.agenticDocExtractionNode_581.ocrModelName, but the node uses an inline model and a fixed credential ID. The declared input is ignored, and the template can bind to an environment-specific credential. Use the configured model reference or remove the unused input.

Also applies to: 115-124, 228-238

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In
`@kits/autonomous-enterprise-audit-sanctions-compliance/flows/autonomous-enterprise-audit-sanctions-compliance.ts`
around lines 18 - 25, Update the model configuration and credential references
in the affected extraction nodes to use the declared
inputs.agenticDocExtractionNode_581.ocrModelName and the runtime-configured
credential binding instead of inline values and fixed credential IDs;
alternatively remove ocrModelName if it is intentionally unused, but preserve
environment-specific configuration.

451-458: ⚠️ Potential issue | 🔴 Critical

Mission critical: send the high-risk audit details to Slack.

The Slack node posts a generic greeting. It does not include the vendor, supervisor result, or MCP verification output. It also uses a fixed channel ID instead of the configured channelName input. The high-risk path can complete without an actionable alert.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In
`@kits/autonomous-enterprise-audit-sanctions-compliance/flows/autonomous-enterprise-audit-sanctions-compliance.ts`
around lines 451 - 458, Update the Slack node configuration identified by id
slackNode_425 so its postMessage text sends an actionable high-risk audit alert
containing the vendor, supervisor result, and MCP verification output. Replace
the hard-coded channel ID with the configured channelName input, while
preserving the Slack action and credentials.

694-699: ⚠️ Potential issue | 🔴 Critical

Mission critical: remove the reverse default edge.

Line 694 already routes InstructorLLMNode_771 to vectorizeNode_704. Lines 726-731 add the reverse default edge. This creates a two-node cycle before vectorNode_637, so the low-risk path can loop instead of reaching persistence.

Also applies to: 725-731

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In
`@kits/autonomous-enterprise-audit-sanctions-compliance/flows/autonomous-enterprise-audit-sanctions-compliance.ts`
around lines 694 - 699, Remove the reverse default edge from vectorizeNode_704
to InstructorLLMNode_771 while preserving the existing
InstructorLLMNode_771-to-vectorizeNode_704 edge. Ensure the flow proceeds toward
vectorNode_637 without introducing a cycle.

220-220: 🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win

Do not cap audit scanning at maxPages: 2.

agenticDocExtractionNode_581 accepts a multi-page document URL and searches has_all_signoffs; any sign-off or sanctions finding on page 3+ can be skipped and route the audit incorrectly. Remove the cap or replace it with a validated maxPages input.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In
`@kits/autonomous-enterprise-audit-sanctions-compliance/flows/autonomous-enterprise-audit-sanctions-compliance.ts`
at line 220, Remove the fixed maxPages: 2 limit from the configuration used by
agenticDocExtractionNode_581, or replace it with a validated input that supports
the full document length. Ensure multi-page documents are scanned beyond page 2
so has_all_signoffs and sanctions findings are not missed.
♻️ Duplicate comments (1)
kits/autonomous-enterprise-audit-sanctions-compliance/flows/autonomous-enterprise-audit-sanctions-compliance.ts (1)

170-198: ⚠️ Potential issue | 🟠 Major

Use the output of extractFromFileNode_877, or remove the node.

agenticDocExtractionNode_581 reads triggerNode_1.output.prompt directly. No value from extractFromFileNode_877 is interpolated. The edge only orders execution. It does not pass the extracted result into documentUrl.

Also applies to: 225-225, 614-620

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In
`@kits/autonomous-enterprise-audit-sanctions-compliance/flows/autonomous-enterprise-audit-sanctions-compliance.ts`
around lines 170 - 198, Update agenticDocExtractionNode_581 and the other
affected references so documentUrl consumes the extracted output from
extractFromFileNode_877 rather than triggerNode_1.output.prompt; alternatively
remove extractFromFileNode_877 and its execution-only edges if its result is not
needed. Ensure every affected interpolation actually passes the extracted value
into documentUrl.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In
`@kits/autonomous-enterprise-audit-sanctions-compliance/flows/autonomous-enterprise-audit-sanctions-compliance.ts`:
- Around line 349-353: Update the external verification request around the
Middesk endpoint to make its demo-only status explicit and configurable for
adopters: expose configuration for the verification URL and authorization
credentials, use those values in the request instead of hardcoded sandbox-only
settings, and document that the sandbox URL must be replaced before production
use.
- Around line 274-286: The classifier routing values in the “Hybrid Search” and
“API” entries are swapped. Update the option values in the classifier
configuration around agentClassifierNode_252 so “Hybrid Search” references the
hybridSearchNode edge and “API” references the apiNode edge, including the
corresponding routing at the other reported occurrence.
- Line 350: Fix the request body in the flow around agenticDocExtractionNode_581
by removing the duplicate has_all_signoffs key, extra commas, and source-less
interpolation, while preserving a single boolean value with a valid fallback.
Keep compliance_checklist as an array rather than a quoted string, and construct
or serialize the payload as structured JSON so vendor_name, document_title, and
extracted_text are safely escaped and the API receives valid, type-correct JSON.

In
`@kits/autonomous-enterprise-audit-sanctions-compliance/prompts/autonomous-enterprise-audit-sanctions-compliance_agent-classifier-node-252_user_1.md`:
- Line 1: Replace the malformed “WriAnalyze” prompt prefix with “Analyze” so the
classifier instruction begins correctly.
- Line 4: Update the Has All Sign-offs interpolation to pass the boolean
document_metadata.has_all_signoffs field from
agenticDocExtractionNode_581.output.structuredData instead of the entire
structuredData object.

---

Outside diff comments:
In
`@kits/autonomous-enterprise-audit-sanctions-compliance/flows/autonomous-enterprise-audit-sanctions-compliance.ts`:
- Around line 18-25: Update the model configuration and credential references in
the affected extraction nodes to use the declared
inputs.agenticDocExtractionNode_581.ocrModelName and the runtime-configured
credential binding instead of inline values and fixed credential IDs;
alternatively remove ocrModelName if it is intentionally unused, but preserve
environment-specific configuration.
- Around line 451-458: Update the Slack node configuration identified by id
slackNode_425 so its postMessage text sends an actionable high-risk audit alert
containing the vendor, supervisor result, and MCP verification output. Replace
the hard-coded channel ID with the configured channelName input, while
preserving the Slack action and credentials.
- Around line 694-699: Remove the reverse default edge from vectorizeNode_704 to
InstructorLLMNode_771 while preserving the existing
InstructorLLMNode_771-to-vectorizeNode_704 edge. Ensure the flow proceeds toward
vectorNode_637 without introducing a cycle.
- Line 220: Remove the fixed maxPages: 2 limit from the configuration used by
agenticDocExtractionNode_581, or replace it with a validated input that supports
the full document length. Ensure multi-page documents are scanned beyond page 2
so has_all_signoffs and sanctions findings are not missed.

---

Duplicate comments:
In
`@kits/autonomous-enterprise-audit-sanctions-compliance/flows/autonomous-enterprise-audit-sanctions-compliance.ts`:
- Around line 170-198: Update agenticDocExtractionNode_581 and the other
affected references so documentUrl consumes the extracted output from
extractFromFileNode_877 rather than triggerNode_1.output.prompt; alternatively
remove extractFromFileNode_877 and its execution-only edges if its result is not
needed. Ensure every affected interpolation actually passes the extracted value
into documentUrl.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI (base), Organization UI (inherited)

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 53062413-d3ff-46a6-84e4-8b6500c2700b

📥 Commits

Reviewing files that changed from the base of the PR and between ca2bd98 and 11a9dbd.

📒 Files selected for processing (3)
  • kits/autonomous-enterprise-audit-sanctions-compliance/flows/autonomous-enterprise-audit-sanctions-compliance.ts
  • kits/autonomous-enterprise-audit-sanctions-compliance/prompts/autonomous-enterprise-audit-sanctions-compliance_agent-classifier-node-252_user_1.md
  • kits/autonomous-enterprise-audit-sanctions-compliance/prompts/autonomous-enterprise-audit-sanctions-compliance_instructor-llmnode-771_user_1.md

Comment on lines +349 to +353
"url": "https://api-sandbox.middesk.com/v1/businesses",
"body": "{\n \"vendor_name\": \"{{ agenticDocExtractionNode_581.output.structuredData.0.annotation.vendor_details.vendor_name || '' }}\",\n \"has_all_signoffs\": {{ ... .has_all_signoffs || false }},\"has_all_signoffs\": {{ ... .has_all_signoffs || false }},,\n \"document_title\": \"{{ agenticDocExtractionNode_581.output.structuredData.0.annotation.document_metadata.document_title || '' }}\",\n \"compliance_checklist\": \"{{ agenticDocExtractionNode_581.output.structuredData.0.annotation.compliance_checklist || [] }}\",\n \"extracted_text\": \"{{ agenticDocExtractionNode_581.output.extractedText || '' }}\"\n}",
"method": "POST",
"headers": "{\"Content-Type\":\"application/json\"}",
"retries": "0",

@coderabbitai coderabbitai Bot Aug 9, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

Configure the external verification endpoint before release.

The API uses a sandbox URL and sends only Content-Type. It has no configurable authorization input. The external verification branch will not work for adopters unless they replace the endpoint and supply credentials. Document this as a demo or expose the endpoint and credential configuration.

Based on learnings, the Middesk sandbox URL is intentionally a non-working demo endpoint. Tell adopters to replace or configure it before use.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In
`@kits/autonomous-enterprise-audit-sanctions-compliance/flows/autonomous-enterprise-audit-sanctions-compliance.ts`
around lines 349 - 353, Update the external verification request around the
Middesk endpoint to make its demo-only status explicit and configurable for
adopters: expose configuration for the verification URL and authorization
credentials, use those values in the request instead of hardcoded sandbox-only
settings, and document that the sandbox URL must be replaced before production
use.

Source: Learnings

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This url just for demo purpose that is why their has no authorization code.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@maitimeraki, understood. The sandbox endpoint can remain without authorization for the demo.

The remaining requirement is documentation. State that the Middesk URL is demo-only, does not perform production verification, and must be replaced with a production endpoint and its required credentials before deployment.

Mission scope reduced.


✏️ Learnings added
Learnt from: maitimeraki
Repo: Lamatic/AgentKit PR: 323
File: kits/autonomous-enterprise-audit-sanctions-compliance/flows/autonomous-enterprise-audit-sanctions-compliance.ts:349-353
Timestamp: 2026-08-09T15:17:44.098Z
Learning: In `kits/autonomous-enterprise-audit-sanctions-compliance/flows/autonomous-enterprise-audit-sanctions-compliance.ts`, the hardcoded Middesk sandbox URL is intentionally demo-only. It has no authorization configuration because the template does not intend it for production verification. Documentation must tell adopters to replace and configure the endpoint before production use.

Note: Learnings are effective only in the context of similar code segments. To apply general coding guidelines, please configure review instructions. You can manage existing learnings in the app.

You are interacting with an AI system.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In
`@kits/autonomous-enterprise-audit-sanctions-compliance/flows/autonomous-enterprise-audit-sanctions-compliance.ts`:
- Line 350: Update the apiNode_483 body construction to serialize the structured
request object as JSON instead of interpolating OCR-derived values into a
literal JSON string. Preserve the existing vendor_name, has_all_signoffs,
document_title, compliance_checklist, and extracted_text mappings while ensuring
quotes, backslashes, and newlines are escaped correctly before the API request
is sent.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI (base), Organization UI (inherited)

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 5adea797-525e-4120-9ddd-030848f819ad

📥 Commits

Reviewing files that changed from the base of the PR and between 11a9dbd and 98d660d.

📒 Files selected for processing (2)
  • kits/autonomous-enterprise-audit-sanctions-compliance/flows/autonomous-enterprise-audit-sanctions-compliance.ts
  • kits/autonomous-enterprise-audit-sanctions-compliance/prompts/autonomous-enterprise-audit-sanctions-compliance_agent-classifier-node-252_user_1.md

@maitimeraki

Copy link
Copy Markdown
Author

I have resolve all things, just merged this.

@coderabbitai

coderabbitai Bot commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

Note

GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 5

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In
`@kits/autonomous-enterprise-audit-sanctions-compliance/prompts/autonomous-enterprise-audit-sanctions-compliance_agent-node-143_system_0.md`:
- Around line 1-5: Update the Autonomous Risk Assessment Supervisor instructions
to explicitly treat missing, errored, timed-out, or malformed Sanctions API,
Memory Logs, and Vector Search results as unavailable verification and route to
HighRiskAgent. Require complete valid evidence before selecting LowRiskAgent,
and do not infer a clean or low-risk entity from incomplete results.

In
`@kits/autonomous-enterprise-audit-sanctions-compliance/prompts/autonomous-enterprise-audit-sanctions-compliance_agentic-doc-extraction-node-581_system_0.md`:
- Around line 1-7: Establish a consistent untrusted-evidence boundary for all
document-derived prompt inputs: in
kits/autonomous-enterprise-audit-sanctions-compliance/prompts/autonomous-enterprise-audit-sanctions-compliance_agentic-doc-extraction-node-581_system_0.md
lines 1-7, mark document content as evidence only and instruct the model to
ignore embedded instructions; in
kits/autonomous-enterprise-audit-sanctions-compliance/prompts/autonomous-enterprise-audit-sanctions-compliance_agent-classifier-node-252_user_1.md
lines 5-6, delimit extractedText before classification; and in
kits/autonomous-enterprise-audit-sanctions-compliance/prompts/autonomous-enterprise-audit-sanctions-compliance_agent-node-143_user_1.md
lines 1-7, delimit extracted text and branch outputs before supervisor
evaluation.

In
`@kits/autonomous-enterprise-audit-sanctions-compliance/prompts/autonomous-enterprise-audit-sanctions-compliance_instructor-llmnode-771_user_1.md`:
- Line 6: Move the “Audit Context:” label to column zero and add a blank line
before it so it is parsed as a separate section rather than part of the
“Document Title” bullet. Preserve the existing prompt content and do not add
cosmetic headings or otherwise address MD041.

In `@kits/autonomous-enterprise-audit-sanctions-compliance/README.md`:
- Around line 23-25: Update the setup requirements in README.md to explicitly
include the MCP generative-model connection alongside the classifier,
supervisor, and JSON output nodes. Ensure the documented prerequisites reflect
the separate MCP model configuration required by the workflow, including the
corresponding setup section referenced by the additional affected lines.
- Line 56: Update
kits/autonomous-enterprise-audit-sanctions-compliance/README.md lines 56-56 to
state that the classifier selects and runs the applicable retrieval, search, or
API verification path; update lines 67-70 to label the three classifier branches
as alternatives. Update
kits/autonomous-enterprise-audit-sanctions-compliance/agent.md lines 101-104 to
describe only the selected classifier path rather than listing all three checks.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI (base), Organization UI (inherited)

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 66a2895d-6571-4af1-b564-7f239b7e2288

📥 Commits

Reviewing files that changed from the base of the PR and between e0d0f8c and 354e482.

📒 Files selected for processing (22)
  • kits/autonomous-enterprise-audit-sanctions-compliance/.gitignore
  • kits/autonomous-enterprise-audit-sanctions-compliance/README.md
  • kits/autonomous-enterprise-audit-sanctions-compliance/agent.md
  • kits/autonomous-enterprise-audit-sanctions-compliance/constitutions/default.md
  • kits/autonomous-enterprise-audit-sanctions-compliance/flows/autonomous-enterprise-audit-sanctions-compliance.ts
  • kits/autonomous-enterprise-audit-sanctions-compliance/lamatic.config.ts
  • kits/autonomous-enterprise-audit-sanctions-compliance/model-configs/autonomous-enterprise-audit-sanctions-compliance_agent-classifier-node-252_generative-model-name.ts
  • kits/autonomous-enterprise-audit-sanctions-compliance/model-configs/autonomous-enterprise-audit-sanctions-compliance_agent-node-143_generative-model-name.ts
  • kits/autonomous-enterprise-audit-sanctions-compliance/model-configs/autonomous-enterprise-audit-sanctions-compliance_hybrid-search-node-546_embedding-model-name.ts
  • kits/autonomous-enterprise-audit-sanctions-compliance/model-configs/autonomous-enterprise-audit-sanctions-compliance_instructor-llmnode-771_generative-model-name.ts
  • kits/autonomous-enterprise-audit-sanctions-compliance/model-configs/autonomous-enterprise-audit-sanctions-compliance_mcp-node-737_generative-model-name.ts
  • kits/autonomous-enterprise-audit-sanctions-compliance/model-configs/autonomous-enterprise-audit-sanctions-compliance_memory-node-421_embedding-model-name.ts
  • kits/autonomous-enterprise-audit-sanctions-compliance/model-configs/autonomous-enterprise-audit-sanctions-compliance_memory-node-421_generative-model-name.ts
  • kits/autonomous-enterprise-audit-sanctions-compliance/model-configs/autonomous-enterprise-audit-sanctions-compliance_memory-retrieve-node-264_embedding-model-name.ts
  • kits/autonomous-enterprise-audit-sanctions-compliance/model-configs/autonomous-enterprise-audit-sanctions-compliance_vectorize-node-704_embedding-model-name.ts
  • kits/autonomous-enterprise-audit-sanctions-compliance/prompts/autonomous-enterprise-audit-sanctions-compliance_agent-classifier-node-252_system_0.md
  • kits/autonomous-enterprise-audit-sanctions-compliance/prompts/autonomous-enterprise-audit-sanctions-compliance_agent-classifier-node-252_user_1.md
  • kits/autonomous-enterprise-audit-sanctions-compliance/prompts/autonomous-enterprise-audit-sanctions-compliance_agent-node-143_system_0.md
  • kits/autonomous-enterprise-audit-sanctions-compliance/prompts/autonomous-enterprise-audit-sanctions-compliance_agent-node-143_user_1.md
  • kits/autonomous-enterprise-audit-sanctions-compliance/prompts/autonomous-enterprise-audit-sanctions-compliance_agentic-doc-extraction-node-581_system_0.md
  • kits/autonomous-enterprise-audit-sanctions-compliance/prompts/autonomous-enterprise-audit-sanctions-compliance_instructor-llmnode-771_system_0.md
  • kits/autonomous-enterprise-audit-sanctions-compliance/prompts/autonomous-enterprise-audit-sanctions-compliance_instructor-llmnode-771_user_1.md

Comment thread kits/autonomous-enterprise-audit-sanctions-compliance/README.md
Comment thread kits/autonomous-enterprise-audit-sanctions-compliance/README.md
@maitimeraki

maitimeraki commented Aug 10, 2026 via email

Copy link
Copy Markdown
Author

@maitimeraki

Copy link
Copy Markdown
Author

I have resolve the bugs.

@github-actions

Copy link
Copy Markdown
Contributor

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Aug 10, 2026

Copy link
Copy Markdown
Contributor
⚠️ Action not completed

Already reviewed.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@github-actions

Copy link
Copy Markdown
Contributor

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Aug 12, 2026

Copy link
Copy Markdown
Contributor
⚠️ Action not completed

Already reviewed.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@github-actions

Copy link
Copy Markdown
Contributor

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Aug 14, 2026

Copy link
Copy Markdown
Contributor
⚠️ Action not completed

Already reviewed.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@akshatvirmani

Copy link
Copy Markdown
Contributor

/validate

@github-actions

Copy link
Copy Markdown
Contributor

📡 Running Studio validation — results will appear here shortly.

@akshatvirmani

Copy link
Copy Markdown
Contributor

@maitimeraki tests are passing but there is 1 file that has 4 comments left.

Also, what are these:

"I have resolve all things, just merged this." "I understand but this is just demo just for things are worked."

????

@github-actions

Copy link
Copy Markdown
Contributor

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Aug 17, 2026

Copy link
Copy Markdown
Contributor
⚠️ Action not completed

Already reviewed.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@github-actions

Copy link
Copy Markdown
Contributor

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Aug 19, 2026

Copy link
Copy Markdown
Contributor
⚠️ Action not completed

Already reviewed.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants