Metsuke (目付) were the censors or the inspectors of Tokugawa Japan. They were bakufu officials ranking somewhat lower than the bugyō. The metsuke were charged with the special duty of detecting and investigating instances of maladministration, corruption or disaffection anywhere in Japan; and particularly amongst the populace having status below the daimyō.
The shogunate recognized the need for some kind of internal intelligence-gathering apparatus and for some degree of covert espionage within its own ranks. It could be said that the metsuke functioned as the Shogun's intelligence agency or as internal spies, reporting to the officials in Edo on events and situations across the country.
The metsuke were charged with focusing on those ranking below daimyō-status; and their counterparts, the ōmetsuke, were responsible for supervising the activities of officials and members of the daimyō (feudal lords).
Although similarly engaged, the reporting protocols of the metsuke and ōmetsuke differed. The metsuke reported to wakadoshiyori who ranked just below the rōjū. The ōmetsuke reported directly to the four or five rōjū at the top of the shogunate bureaucracy. By design, the intelligence-gathering activities of the metsuke was intended to complement those of the ōmetsuke even though there was no official reporting relationship between the two somewhat independent groups.
There were at any given time as many as twenty-four metsuke.
The bureaucracy of the Tokugawa shogunate expanded on an ad hoc basis, responding to perceived needs and changing circumstances. Sometimes one or more of the metsuke or ōmetsuke would have been selected to address a specific or even a unique problem. For example, Arao Norimasa in the period from 1852 through 1854 was charged with special duties as kaibo-gakari-metsuke.
The prefix kaibō-gakari meaning "in charge of maritime defense" was used with the titles of some bakufu officials after 1845. This term was used to designate those who bore a special responsibility for overseeing coastal waters, and by implication, for dealing with matters involving foreigners. "Kaibō-gakari-metsuke" later came to be superseded by the term gaikoku-gakari. These developments prceeded the Gaikoku bugyō system which began just prior to the negotiations which resulted in the Harris Treaty. First appointed in August 1858, the gaikoku-bugyō were bakufu officials who were charged with advising the government on foreign affairs and who were tasked with conducting negotiations with foreign diplomats both in Japan and abroad.