Skip to content

Threat intel

Classify IPs, domains, URLs, and file hashes offline, then enrich them against threat-intel reputation feeds

Connector software
Free and open source
Service credentials
Not needed
Use with an agent

Install the Orchard skill in your project to help your agent find connectors, configure them, and verify SQL results.

npx skills add Query-farm/vgi-skills --skill orchard

Copy this request into your coding agent to get started.

Use https://query.farm/products/orchard/connectors/threatintel/index.md to help me query Threat intel with DuckDB or Haybarn 2.0.1 and VGI protocol 3.4. Ask only for missing details about the result I need or whether I want local execution, self-hosting or Query Farm hosting. Check the connector's actual hosting availability, credentials and input requirements. Read one format of each needed reference and the exact object declarations before writing SQL. Use a released connector, and distinguish a saved example result from anything you actually execute. If you cannot run the query, tell me what remains to verify.

See what you can query

Example output · captured
Connector release
v0.5.0
Engine
2.0.1
VGI protocol
3.4.0
WITH iocs(ioc) AS (
  VALUES ('185.220.101.1'), ('10.0.0.5'), ('malware-c2.example'),
         ('https://good.example/login'), ('44d88612fea8a8f36de82e1278abb02f'), ('not-an-indicator!!')
), typed AS (
  SELECT ioc,
         threatintel.main.indicator_type(ioc) AS kind,
         threatintel.main.is_private_ip(ioc) AS is_private
  FROM iocs
)
SELECT typed.ioc, typed.kind, t.description, typed.is_private,
       typed.kind IS NOT NULL AND NOT typed.is_private AS needs_lookup
FROM typed
LEFT JOIN threatintel.main.indicator_types AS t ON t.indicator_type = typed.kind
ORDER BY needs_lookup DESC, typed.ioc
Result · first 5 rows
ioc kind description is_private needs_lookup
185.220.101.1 ipv4 IPv4 address in dotted-quad notation false true
44d88612fea8a8f36de82e1278abb02f md5 MD5 file hash (32 hexadecimal characters) false true
https://good.example/login url Absolute HTTP or HTTPS URL false true
malware-c2.example domain DNS domain name (hostname) false true
10.0.0.5 ipv4 IPv4 address in dotted-quad notation true false

Quick start

Choose where to run Threat intel, then follow the steps below.

The connector runs alongside DuckDB or Haybarn. No Query Farm account is needed.

1. Install the vgi extension

Run this in your SQL client. On DuckDB, keep FROM query_farm on LOAD in later sessions.

setup.sql
SET allow_extension_repositories = 'allowed';

CREATE EXTENSION REPOSITORY IF NOT EXISTS query_farm
    WITH PREFIX 'https://duckdb-extensions.query.farm';

INSTALL vgi FROM query_farm;
LOAD vgi FROM query_farm;

2. Attach the connector

Attach the release directly

Downloads the latest release for your platform and caches it locally.

ATTACH 'threatintel' AS threatintel (
  TYPE vgi,
  LOCATION 'github-auto://Query-farm/vgi-threatintel'
);

3. Run a query

query.sql
WITH iocs(ioc) AS (
  VALUES ('185.220.101.1'), ('10.0.0.5'), ('malware-c2.example'),
         ('https://good.example/login'), ('44d88612fea8a8f36de82e1278abb02f'), ('not-an-indicator!!')
), typed AS (
  SELECT ioc,
         threatintel.main.indicator_type(ioc) AS kind,
         threatintel.main.is_private_ip(ioc) AS is_private
  FROM iocs
)
SELECT typed.ioc, typed.kind, t.description, typed.is_private,
       typed.kind IS NOT NULL AND NOT typed.is_private AS needs_lookup
FROM typed
LEFT JOIN threatintel.main.indicator_types AS t ON t.indicator_type = typed.kind
ORDER BY needs_lookup DESC, typed.ioc
More example queries →
Technical details
Verified connector release
v0.5.0
Engine
2.0.1
VGI protocol
3.4.0
Verified on
December 1, 2026
Release notes on GitHub
Pin a version for production

When running the connector yourself, keep a specific release until you’re ready to upgrade. Replace the ATTACH statement above with this one and follow the same extension and credential setup.

Attach the release directly

Uses the verified release each time you attach the connector.

ATTACH 'threatintel' AS threatintel (
  TYPE vgi,
  LOCATION 'github-auto://Query-farm/[email protected]'
);

Overview

Enrich cyber indicators against threat-intel reputation sources; classify offline

Catalog

Everything threatintel exposes once attached — read straight from the worker's released build.

threatintel 1 schema
main 1 view · 3 functions

Threat-intel indicator classification and reputation-enrichment functions.

Schema examples (12)
Examples (12)

Classify an IPv4 address string into its indicator (IoC) type.

SELECT threatintel.main.indicator_type('8.8.8.8') AS kind;

Flag a private/reserved (RFC1918) IP that should never be sent to an external reputation feed.

SELECT threatintel.main.is_private_ip('10.0.0.5') AS is_private;

Enrich a single indicator against the configured reputation source, projecting the verdict fields.

SELECT indicator, malicious, score, categories
FROM threatintel.main.reputation('1.2.3.4');

Look up an indicator against an explicit reputation adapter with an API key, keeping only the malicious flag, score, and categories.

SELECT malicious, score, categories
FROM threatintel.main.reputation('evil.example.com', base_url := 'https://my-reputation-adapter.internal/reputation', api_key := 'YOUR_KEY');
8 more examples

Triage a mixed batch of indicators: classify each with indicator_type, attach the type's description from the indicator_types view, flag private IPs with is_private_ip, and mark which rows need a reputation lookup (4 of the 6 here: the private 10.0.0.5 and the unrecognized string do not).

WITH iocs(ioc) AS (
  VALUES ('185.220.101.1'), ('10.0.0.5'), ('malware-c2.example'),
         ('https://good.example/login'), ('44d88612fea8a8f36de82e1278abb02f'), ('not-an-indicator!!')
), typed AS (
  SELECT ioc,
         threatintel.main.indicator_type(ioc) AS kind,
         threatintel.main.is_private_ip(ioc) AS is_private
  FROM iocs
)
SELECT typed.ioc, typed.kind, t.description, typed.is_private,
       typed.kind IS NOT NULL AND NOT typed.is_private AS needs_lookup
FROM typed
LEFT JOIN threatintel.main.indicator_types AS t ON t.indicator_type = typed.kind
ORDER BY needs_lookup DESC, typed.ioc;
Result · first 5 rows
ioc kind description is_private needs_lookup
185.220.101.1 ipv4 IPv4 address in dotted-quad notation false true
44d88612fea8a8f36de82e1278abb02f md5 MD5 file hash (32 hexadecimal characters) false true
https://good.example/login url Absolute HTTP or HTTPS URL false true
malware-c2.example domain DNS domain name (hostname) false true
10.0.0.5 ipv4 IPv4 address in dotted-quad notation true false

Count a batch of indicators per IoC type, listing every type in the indicator_types view (types absent from the batch show 0; the unrecognized string matches no type and is not counted).

WITH iocs(ioc) AS (
  VALUES ('185.220.101.1'), ('8.8.8.8'), ('10.0.0.5'), ('malware-c2.example'),
         ('44d88612fea8a8f36de82e1278abb02f'),
         ('e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855'), ('not-an-indicator!!')
)
SELECT t.indicator_type, count(i.ioc) AS n_indicators
FROM threatintel.main.indicator_types AS t
LEFT JOIN iocs AS i ON threatintel.main.indicator_type(i.ioc) = t.indicator_type
GROUP BY t.indicator_type
ORDER BY t.indicator_type;

Sanity-check a reputation adapter: compare the type the feed reports for a looked-up indicator with the offline indicator_type classification (types_agree is false when the adapter mislabels it). Requires a reachable base_url; returns no rows when the feed does not know the indicator.

SELECT r.indicator, r.type AS feed_type,
       threatintel.main.indicator_type(r.indicator) AS offline_type,
       r.type = threatintel.main.indicator_type(r.indicator) AS types_agree
FROM threatintel.main.reputation('malware-c2.example',
       base_url := 'https://my-reputation-adapter.internal/reputation') AS r
ORDER BY r.indicator;

Classify a 64-hex-character file hash as sha256.

SELECT threatintel.main.indicator_type('e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855') AS kind;

Flag a private/reserved (RFC1918) IP that should not be looked up.

SELECT threatintel.main.is_private_ip('10.0.0.5') AS private;

A routable public IP is not private (safe to enrich).

SELECT threatintel.main.is_private_ip('8.8.8.8') AS private;

A private/reserved IP is triaged to zero reputation rows before any network call.

SELECT count(*) AS n FROM threatintel.main.reputation('10.0.0.5');

An unsupported indicator string yields zero reputation rows (no lookup).

SELECT count(*) AS n FROM threatintel.main.reputation('not-an-indicator');
Views
indicator_types 3 examples3 cols

Reference table of the indicator (IoC) types this worker classifies — the exact closed set of values indicator_type() can return — each with a description and a canonical example. Browse it to learn the classifier's output space; VALUES-backed, so it scans offline with no network call.

Columns
indicator_type VARCHAR
The IoC type name, one of the values indicator_type() emits (ipv4/ipv6/domain/url/md5/sha1/sha256).
description VARCHAR
Human-readable description of the indicator type.
example VARCHAR
A canonical example value of this indicator type.
Examples (3)

List every IoC type the worker recognizes, with a description and a canonical example of each.

SELECT indicator_type, description, example
FROM threatintel.main.indicator_types
ORDER BY indicator_type;

Look up the canonical example and human description for a single indicator type (sha256).

SELECT description, example
FROM threatintel.main.indicator_types
WHERE indicator_type = 'sha256';

Count a batch of indicators per IoC type, listing every type in the indicator_types view (types absent from the batch show 0; the unrecognized string matches no type and is not counted).

WITH iocs(ioc) AS (
  VALUES ('185.220.101.1'), ('8.8.8.8'), ('10.0.0.5'), ('malware-c2.example'),
         ('44d88612fea8a8f36de82e1278abb02f'),
         ('e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855'), ('not-an-indicator!!')
)
SELECT t.indicator_type, count(i.ioc) AS n_indicators
FROM threatintel.main.indicator_types AS t
LEFT JOIN iocs AS i ON threatintel.main.indicator_type(i.ioc) = t.indicator_type
GROUP BY t.indicator_type
ORDER BY t.indicator_type;
Link
Scalar functions
indicator_type (value VARCHAR) 3 examples

Classify an indicator as ipv4/ipv6/domain/url/md5/sha1/sha256, or NULL if unrecognized

Arguments
value VARCHAR
A single indicator observable to classify. An IP address / domain name / URL / file-hash string is accepted; the type is inferred from the value's shape and an unrecognized string returns NULL.
ReturnsVARCHAR
Examples (3)

Classify an IPv4 address; returns 'ipv4'.

SELECT threatintel.main.indicator_type('8.8.8.8');

Classify a 32-hex-character file hash as 'md5'.

SELECT threatintel.main.indicator_type('44d88612fea8a8f36de82e1278abb02f');

Triage a mixed batch of indicators: classify each with indicator_type, attach the type's description from the indicator_types view, flag private IPs with is_private_ip, and mark which rows need a reputation lookup (4 of the 6 here: the private 10.0.0.5 and the unrecognized string do not).

WITH iocs(ioc) AS (
  VALUES ('185.220.101.1'), ('10.0.0.5'), ('malware-c2.example'),
         ('https://good.example/login'), ('44d88612fea8a8f36de82e1278abb02f'), ('not-an-indicator!!')
), typed AS (
  SELECT ioc,
         threatintel.main.indicator_type(ioc) AS kind,
         threatintel.main.is_private_ip(ioc) AS is_private
  FROM iocs
)
SELECT typed.ioc, typed.kind, t.description, typed.is_private,
       typed.kind IS NOT NULL AND NOT typed.is_private AS needs_lookup
FROM typed
LEFT JOIN threatintel.main.indicator_types AS t ON t.indicator_type = typed.kind
ORDER BY needs_lookup DESC, typed.ioc;
Result · first 5 rows
ioc kind description is_private needs_lookup
185.220.101.1 ipv4 IPv4 address in dotted-quad notation false true
44d88612fea8a8f36de82e1278abb02f md5 MD5 file hash (32 hexadecimal characters) false true
https://good.example/login url Absolute HTTP or HTTPS URL false true
malware-c2.example domain DNS domain name (hostname) false true
10.0.0.5 ipv4 IPv4 address in dotted-quad notation true false
Link
is_private_ip (value VARCHAR) 2 examples

Report whether an indicator is a private/reserved IP (RFC1918/loopback/etc.); false for non-IPs

Arguments
value VARCHAR
An IP address literal to test. Any non-IP input (a domain, URL, file hash, or NULL) returns false, so it is safe to apply directly to a mixed column of indicators.
ReturnsBOOLEAN
Examples (2)

An RFC1918 address is private; returns true.

SELECT threatintel.main.is_private_ip('10.0.0.5');

A routable public address; returns false (safe to look up).

SELECT threatintel.main.is_private_ip('8.8.8.8');
Link
Table functions
reputation (indicator VARCHAR, base_url := VARCHAR, api_key := VARCHAR, timeout_ms := BIGINT) 2 examples

Look up one indicator against a threat-intel reputation source; returns at most one verdict row

Positional arguments
indicator VARCHAR
A single indicator observable to look up against the reputation source. An IP address / domain name / URL / file-hash string is accepted; private/reserved and unrecognized inputs return zero rows without a network call.
Named arguments
base_url := VARCHAR
Override the reputation API base URL · default ""
api_key := VARCHAR
API key for the reputation source (if required) · default ""
timeout_ms := BIGINT
Per-request HTTP timeout in milliseconds · default 15000
Returns columns
indicator VARCHAR
The looked-up indicator, echoed back.
type VARCHAR
IoC type as reported by the source (ipv4/ipv6/domain/url/md5/sha1/sha256).
malicious BOOLEAN
Whether the source classifies the indicator as malicious.
score DOUBLE
Reputation/threat score, or NULL when the source reports none.
categories VARCHAR[]
Threat categories the source assigned (for example malware, phishing, or c2).
source VARCHAR
Name of the reputation feed that produced the verdict.
last_seen VARCHAR
When the source last observed the indicator (ISO-8601 string).
Examples (2)

A private/reserved IP is triaged to zero verdict rows before any network call (no public-reputation budget spent on internal hosts); count(*) returns 0.

SELECT count(*) AS rows_for_private_ip
FROM threatintel.main.reputation('10.0.0.5');

An unsupported indicator string yields zero verdict rows (no lookup); count(*) returns 0.

SELECT count(*) AS rows_for_unsupported
FROM threatintel.main.reputation('not-an-indicator');
Link

Try these queries

Classify an IPv4 address string into its indicator (IoC) type.

SELECT threatintel.main.indicator_type('8.8.8.8') AS kind

Uses indicator_type

Flag a private/reserved (RFC1918) IP that should never be sent to an external reputation feed.

SELECT threatintel.main.is_private_ip('10.0.0.5') AS is_private

Uses is_private_ip

Enrich a single indicator against the configured reputation source, projecting the verdict fields.

SELECT indicator, malicious, score, categories
FROM threatintel.main.reputation('1.2.3.4')

Uses reputation

Look up an indicator against an explicit reputation adapter with an API key, keeping only the malicious flag, score, and categories.

SELECT malicious, score, categories
FROM threatintel.main.reputation('evil.example.com', base_url := 'https://my-reputation-adapter.internal/reputation', api_key := 'YOUR_KEY')

Uses reputation

Count a batch of indicators per IoC type, listing every type in the indicator_types view (types absent from the batch show 0; the unrecognized string matches no type and is not counted).

WITH iocs(ioc) AS (
  VALUES ('185.220.101.1'), ('8.8.8.8'), ('10.0.0.5'), ('malware-c2.example'),
         ('44d88612fea8a8f36de82e1278abb02f'),
         ('e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855'), ('not-an-indicator!!')
)
SELECT t.indicator_type, count(i.ioc) AS n_indicators
FROM threatintel.main.indicator_types AS t
LEFT JOIN iocs AS i ON threatintel.main.indicator_type(i.ioc) = t.indicator_type
GROUP BY t.indicator_type
ORDER BY t.indicator_type

Uses indicator_typeindicator_types

List every IoC type the worker recognizes, with a description and a canonical example of each.

SELECT indicator_type, description, example
FROM threatintel.main.indicator_types
ORDER BY indicator_type

Uses indicator_types

13 more examples in the Catalog, each listed under the table or function it uses.

Questions it can answer

Plain-English questions from the worker's agent test tasks. An AI agent with this catalog attached should answer each one with SQL.

  • What indicator type does the string 8.8.8.8 classify as?
  • How many reputation rows are returned for the private IP address 10.0.0.5 (which is triaged out before any lookup)?
  • Using the worker's indicator_types reference view, how many distinct indicator (IoC) types does this worker recognize?
  • According to the indicator_types reference view, what is the canonical example value for the sha256 indicator type?

Threat intel is an independent open-source connector from Query.Farm. It is not affiliated with, endorsed by or sponsored by the services, projects or organisations it works with. Product names, logos and trademarks belong to their respective owners.