Skip to content

Configuration

Every setting ActiveSanction.configure and Client.new accept. Type and default come from Configuration itself — see site/bin/generate_configuration.rb — so a setting added or retyped here needs no edit to this page. The one line of effect for each is written by hand below the table. Full method signatures are in the generated API documentation.

An unknown setting, or a value a writer refuses, raises ConfigurationError at the point it is set. See the error hierarchy.

SettingTypeDefaultEffect
cache_dirString$XDG_CACHE_HOME/active_sanction, or ~/.cache/active_sanction when unsetWhere raw payloads and conditional-GET validators are cached. Recoverable by fetching again; safe to delete.
candidate_limitInteger200Names the index hands the scorer per query. Overridden per query with `limit:`.
doctor_toleranceFloat0.1How far one of the doctor's measurements may move from the last sync before it is reported. Overridden per run with `tolerance:`.
instrumenterT.untypednilWhere the six structured events go. Anything answering `#call(event)`; `nil` means nothing is listening, and costs nothing. See instrumentation.
loggerT.untypednilAnything Logger-shaped, or `nil`.
max_redirectsInteger5Redirect hops followed before giving up.
max_retriesInteger2Attempts after the first, for a retryable failure.
normalizer_dictionaryActiveSanction::Normalizer::DictionaryNormalizer::DictionaryThe token lists the normalizer strips per entity type. See how matching works.
open_timeoutNumeric10Seconds to establish a connection.
read_timeoutNumeric60Seconds to wait for the next chunk of a body, not for the whole of one.
retain_payloadsInteger3Raw payloads kept per source, for re-parsing or diffing a suspicious file.
retry_backoffNumeric1.0Seconds before the first retry, doubling on each one after it.
scorer_weightsActiveSanction::Scorer::WeightsScorer::WeightsWhat each signal the scorer reads is worth. See how matching works.
screening_limitInteger10Results a screening call returns, highest score first. Overridden per query with `limit:`.
screening_thresholdFloat75.0The lowest score a screening call reports, on the 0..100 scale. Overridden per query with `threshold:`.
sourcesT.nilable(T::Array[Symbol])nilWhich lists a sync runs, by key. `nil` means every registered source.
stale_afterT.nilable(Numeric)86400Seconds before `stale?` reports a source due for a sync. `nil` disables the clock; does not cap how long a cached copy may be used.
storageActiveSanction::Storage::BaseStorage::FileSystemWhere synced lists are read from and written to. Any Storage::Base — FileSystem, ActiveRecord, Memory, or your own.
storage_dirString~/.active_sanctionWhere the filesystem store keeps parsed snapshots, when `storage` is left at its default.
sync_concurrencyInteger1How many publishers are fetched from at once — never how hard any one of them is asked.
user_agentString"active_sanction/1.1.1 (+https://github.com/Babystep-Technologies/active_sanction)"Sent on every request. Cannot be blank — some publishers 403 a request with none.
xml_backendSymbol:rexmlWhich XML library the XML toolkit parses with. `:nokogiri` for a host already parsing large documents.

Two settings that travel with every result

Section titled “Two settings that travel with every result”

scorer_weights and normalizer_dictionary are not simple values — they are objects with their own defaults, described in full on How matching works rather than restated here. scorer_weights is stamped onto every MatchResult, so a tuned installation’s decisions stay explainable after the defaults move.

The two settings a host most often tunes.

  • screening_threshold trades recall for precision. See the accuracy report for what moving it away from the default costs, measured rather than guessed.
  • candidate_limit trades recall for latency: it bounds how many names the index hands the scorer before a threshold is applied. See performance characteristics.
ActiveSanction.configure do |c|
c.user_agent = "my-app/1.0 (compliance@example.com)"
c.screening_threshold = 80
end
ActiveSanction.config.screening_threshold # => 80.0

Client.new accepts every setting above as a keyword argument, for a process holding more than one configuration at once:

audit_client = ActiveSanction::Client.new(sources: %i[ofac_sdn], screening_threshold: 60)

Configuration#with derives a copy from an existing, frozen configuration with some settings changed:

audit = config.with(storage: pinned_store, sources: %i[ofac_sdn])