Let's say we have a small civilization that built a wall (Great Wall of China as an example, but with no open sections, all contiguous, besides gated castles) of 300 miles all around their country, totally closing access to their mainland from North, East and South and having its west border facing a sea.
That civilization was able to domesticate a sort of flying lizard that enables them to have a small air cavalry. As the flying lizards don't have a large autonomy, they have to be used defensively only.
They also found, by raw chance, that by leaving stale bread around moldy lemons they were able to get a kind of mold that, if powdered and eaten, reduces inflammation and helps fight infection.
As well they invented repeating crossbows with poisoned arrows. The poison they use paralyzes a man or animal, and stops their hearth in two or so minutes. Crossbowmen use those to man their walls and shoot at any approaching invading army. Their flying lizards cavalry is also used to drop volleys of those poisoned arrows from above along with a kind of flammable liquid, similar to Greek Fire. They also have Trebuchets that launch explosive balls with that Greek Fire of sorts.
Those flying lizards were domesticated by a tribe from the central hills on that country, and no other tribe was able to ever mount the lizards, as they are raised along their riders since their infancy. So, only riders from that tribe are able to successfully mount the flying lizards and take them to combat.
That civilization produces all food they need inside their walls, so they don't need to trade with neighboring civilizations for survival, but they keep a flourishing trade through their gates to a series of special open market cities along the walls were foreign presence is allowed. Foreigners are not allowed past those border cities, and if they get caught inside the country the punishment is death.
They have a very strong cultural unity, based on a religion that proclaims them as the single chosen people of a God that, for them, is the creator and ruler of all things. (let's say like ancient Israel for example) That religion also teaches them if they mix with foreigners they would break their covenant with their God and will suffer the fate of being conquered and enslaved by foreign powers.
Their technological and cultural level (and that of their neighbors) is equivalent to very early Middle Ages (5th century AD) and their region is like the Levant, a very populated and ancient region with plenty of markets and with at least three large and powerful Empires fighting for hegemony there.
My question is: how would that small civilization, while strong, and very well defended and entrenched, be able to avoid external powers to steal their knowledge, especially their flying lizards, the Greek Fire and the antibiotic mold medicine, through spies getting in or deserters going out?
There is no magic whatsoever of any kind (not even miracles through praying or any other ritual).